← Back to Functions
Question 350
Vowel Counter Function
Vowel Counter Function
Write def count_vowels(text: str) -> int that returns how many characters of the text are vowels: any of a, e, i, o, u in lower or upper case. Loop with for ch in text and test each character with the membership operator in, as in ch in 'aeiouAEIOU', which is True when the character is one of those letters; keep a running count and return it. Do NOT write a main block or any top-level test code; the tests construct the calls. Input: one line of text, which the tests read and pass to your function before printing the value it returns.
Expected Output:
3= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Functions
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.