Vowel Counter
Easypython
Count how many vowels (a, e, i, o, u) appear in a sentence, counting both uppercase and lowercase.
Approach: loop through every character in the sentence and check (case-insensitively) whether it's one of the five vowels.
Input: One line: a sentence.
Output: One line: Vowel count: <count>
Example 1
Input
Programming is fun
Output
Vowel count: 5
- 1 <= length <= 1000
Hint 1
Check membership with in: char.lower() in "aeiou".
Hint 2
Loop over every character in the sentence, including spaces — spaces just won't match any vowel.
Loop through every character in the sentence and test char.lower() in "aeiou" — this catches both uppercase and lowercase vowels in one check. Counting the characters that pass gives the total vowel count. ("Programming is fun" has vowels o, a, i in "Programming", i in "is", and u in "fun" — five in total.)