0
The following code must retrun True,True then False and False but it is returning True,False,False and None.help fix this.
def has_a_vowel(a_str): for letter in a_str: if letter in "aeiou": return True else: return False print("Done!") print(has_a_vowel("abba")) print(has_a_vowel("beeswax")) print(has_a_vowel("syzygy")) print(has_a_vowel(""))
1 Antwort
+ 8
Try this:
def has_a_vowel(a_str):
for letter in a_str:
if letter in "aeiou":
return True
return False
print(has_a_vowel("abba"))
print(has_a_vowel("beeswax"))
print(has_a_vowel("syzygy"))
print(has_a_vowel(""))
https://code.sololearn.com/cuH2gx4FQB9K/?ref=app