Coding basics · 20 of 20
Count the vowels
Return how many vowels (a, e, i, o, u, upper or lower case) are in the string.
What you need
A string works like a list of characters: for ch in s visits each one. in checks whether something appears, and .lower() makes a lower-case copy.
for ch in "Hi!":
print(ch) # H, i, !
"e" in "hello" # True
"A".lower() # "a"Examples
Input s = "hello world"
Output 3
Input s = "AEIOU"
Output 5