Count Vowels
Write a function count_vowels that takes a string s and returns the number of vowels a, e, i, o, u in it. Letter case does not matter. A for loop over the characters of the string and a counter will help.
Примеры
Ввод
"hello"Вывод
2Ввод
"python"Вывод
1Ввод
"xyz"Вывод
0Нужно реализовать
def count_vowels(s: str) -> int:
Теги
strings
Prihláste sa, aby ste videli históriu odoslaní
Prihlásiť saPrihláste sa, aby ste mohli používať AI mentora
Prihlásiť saTests8
Visible tests
Skrytý test 7
Skrytý test 8
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid