def countVowels(word): total = 0 for c in word.lower(): if c in 'aeiou': total += 1 return total # or using clever comprehension syntax and the fact that # True is treated as value 1 and False as value 0 in a sum def countVowels(word): return sum(c in 'aeiou' for c in word.lower())