Skip to content

Commit 213d95d

Browse files
committed
update plates.py checks
1 parent ab29bfa commit 213d95d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pset2/plates.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ def is_valid(s):
2626
first_num = s.index(character)
2727
break
2828
# check if there is no alphabet after first num
29-
for character in s:
30-
if s.index(character)<= first_num:
31-
pass
32-
else:
33-
if character.isalpha():
34-
return False
35-
#all conditions satisfied
29+
for character in s[first_num:]:
30+
if character.isalpha():
31+
return False
32+
# all conditions satisfied
3633
return True
3734

3835

0 commit comments

Comments
 (0)