Python Python Basics Types and Branching Booleans

walter fernandez
walter fernandez
4,991 Points

hello, I need help.

I need to Assign identifier numVowels to the number of vowels in the given string grocery.thanks.

1 Answer

vowels = "Treehouse is Great"
numVowels = 0
for i in vowels:
    if (i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u'
            or i == 'A' or i == 'E' or i == 'I' or i == 'O' or i == 'U'):
        numVowels = numVowels + 1

print("Number of vowels are:")