Kodewick
Start learning →
Starter←→0 / 100

Count the vowels

#028StarterStringsLoops3 min

The tea shop is laying out its new menu, and the owner wants to know how many vowels (a e i o u) are in each name. Write count_vowels(name) to return how many, upper or lower case.

Examples
count_vowels("Taro Latte")→4
count_vowels("MATCHA")→2
count_vowels("")→0
main.py
def count_vowels(name):
    count = 0
    for ch in name.lower():
        # your code here: a vowel adds 1 to count
        pass
    return count
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.