From be4f208ea2d052a8cdae66a86ab7498d9f29c589 Mon Sep 17 00:00:00 2001 From: boraxpr Date: Tue, 5 Nov 2019 14:48:01 +0700 Subject: [PATCH] bite 29 --- 29/wrong_char.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/29/wrong_char.py b/29/wrong_char.py index f31cc71..95cef33 100644 --- a/29/wrong_char.py +++ b/29/wrong_char.py @@ -1,5 +1,4 @@ def get_index_different_char(chars): - result = [] Al = 0 nonAl = 0 for char in chars: @@ -18,17 +17,17 @@ def get_index_different_char(chars): for char in chars: charS = str(char) if not charS.isalnum(): - result.append(chars.index(char)) + index = int(chars.index(char)) else: for char in chars: charS = str(char) if charS.isalnum(): - result.append(chars.index(char)) - return result + index = int(chars.index(char)) + # print(type(index)) + return index -print(get_index_different_char( - [2, '.', ',', '!'])) -# +print(get_index_different_char([2, '.', ',', '!'])) + # A = ["1","3","A"] # print(A.index("A"))