[Solved] Need to find vowels inside of a word [duplicate]


while True: #@ 1
    vowels = 0 #@ 2
    consonants = 0
    word = raw_input(">>Enter a word: ").lower() #@ 3
    if word != "stop": #@ 4
        for letter in word: #@5
            if letter in ["a", "e", "i", "o", "u"]:
                vowels += 1
            else:
                consonants += 1

        print "Vowels: ", vowels
        print "Consonants: ", consonants
    else: #@ 6
        break

Explanation:

@ 1 makes this program loop forever

@ 2 reset the vowels and consonants count to 0

@ 3 User input, the .lower() makes this word lowercase to avoid having ‘A’ and ‘a’.

@ 4 if the word isn’t ‘stop’ it will countinue

@ 5 loops trought each letter in the word and increments the vowerls/consonants if they meet the criteria

@ 6 if the word was ‘stop’ the program ends.

3

solved Need to find vowels inside of a word [duplicate]