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 def more_vowels(word1, word2): """ This function takes two words and returns the one with more vowels. If they both have an equal number of vowels, it returns the first one. """ if count_vowels(word1) >= count_vowels(word2): return word1 else: return word2 ### To test: print "mouse vs. dog: " + more_vowels("mouse", "dog") + " has more vowels" print "my vs. their: " + more_vowels("my", "their") + " has more vowels"