letters1 = "abcdefghijklmnopqrstuvwxyz"
letters2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def is_valid(strs):
char_b = True
for char in range(0, len(strs)):
if strs[char] not in (letters1 or letters2):
char_b == False
return char_b
I don't understand why this won't work, anyone mind giving me a hint? It just always returns true.
(letters1 or letters2)is equal toletters1string.ascii_lowercaseandstring.ascii_uppercase) instead of definining manuallyletters{}.str.isalpha()method==by=but this is first example where typo is opposite!!