Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for Count Vowels by flatline
def count_vowels(text: str) -> int:
it = iter(text)
vowel = next((a for a in it if a in "aeiouAEIOU"), None)
result = 0
while vowel:
result += 1
vowel = next((a for a in it if a in "aeiouAEIOU"), None)
return result
Oct. 5, 2023
Comments: