Skip to content

Commit 4df81c5

Browse files
author
boraxpr
committed
bite 189
1 parent 9fda0dc commit 4df81c5

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

189/control_flow.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ def filter_names(names):
88
filtered_list = []
99
for name in names:
1010
# print(name[0])
11-
checker = 0
11+
namekun = list(name)
12+
# checker = 0
1213
if IGNORE_CHAR.title() == name[0] or IGNORE_CHAR == name[0]:
1314
continue
14-
if QUIT_CHAR == name[0] or QUIT_CHAR.title() == name[0]:
15-
return filtered_list
16-
for char in name:
17-
if char.isdigit():
18-
checker = 1
19-
break
20-
if checker == 0:
21-
filtered_list.append(name)
22-
if name == names[-1] or names.index(name) == 5:
15+
if QUIT_CHAR == name[0]:
2316
return filtered_list
17+
if any(char.isdigit() for char in name):
18+
continue
19+
filtered_list.append(name)
20+
21+
return filtered_list.__str__()
2422

2523

26-
print(filter_names(['tim', 'amber', 'ana', 'c1ndy', 'sara', 'molly', 'henry']))
24+
print(filter_names(['t1im', 'amber', 'ana', 'c1ndy', 'sara', 'molly', 'henry']))

0 commit comments

Comments
 (0)