Skip to content

Commit be4f208

Browse files
author
boraxpr
committed
bite 29
1 parent 891d385 commit be4f208

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

29/wrong_char.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
def get_index_different_char(chars):
2-
result = []
32
Al = 0
43
nonAl = 0
54
for char in chars:
@@ -18,17 +17,17 @@ def get_index_different_char(chars):
1817
for char in chars:
1918
charS = str(char)
2019
if not charS.isalnum():
21-
result.append(chars.index(char))
20+
index = int(chars.index(char))
2221
else:
2322
for char in chars:
2423
charS = str(char)
2524
if charS.isalnum():
26-
result.append(chars.index(char))
27-
return result
25+
index = int(chars.index(char))
26+
# print(type(index))
27+
return index
2828

2929

30-
print(get_index_different_char(
31-
[2, '.', ',', '!']))
32-
#
30+
print(get_index_different_char([2, '.', ',', '!']))
31+
3332
# A = ["1","3","A"]
3433
# print(A.index("A"))

0 commit comments

Comments
 (0)