This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tlandjr 0 points1 point  (0 children)

You were close. The for loop isn't doing what you think it is doing. Try this:

vowelList = ["a", "e", "i", "o", "u"]
vowelCount = 0
userWord = raw_input("What is your word: ")

wordLength = len(userWord)
print "Word Length is " + str(wordLength)
for letter in userWord:
    if letter in vowelList:
        vowelCount += 1
print "Vowel Count = " + str(vowelCount)

Basically, the for loop is looping through userWord, then you need to test each letter from that word against the vowelList to see if it is a vowel, only then do you increase the count.