def count_vowels(word): """ This function takes a word and returns the number of vowels in that word. """ count = 0 for letter in word: if letter=="a" or letter=="e" or letter=="i" or letter=="o" or letter=="u": count = count + 1 return count ### To test: print "mouse has " + str(count_vowels("mouse")) + " vowels" print "dog has " + str(count_vowels("dog")) + " vowels"