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
PostgreSQLv16

Koodin suorituksen tulos näkyy tässä

Tests8
Visible tests
Piilotettu testi 7
Piilotettu testi 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