We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab29bfa commit 213d95dCopy full SHA for 213d95d
1 file changed
pset2/plates.py
@@ -26,13 +26,10 @@ def is_valid(s):
26
first_num = s.index(character)
27
break
28
# 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
+ for character in s[first_num:]:
+ if character.isalpha():
+ return False
+ # all conditions satisfied
36
return True
37
38
0 commit comments