Count the vowels · Contar vogais
Count the vowels
Count how many characters of a string are vowels — a, e, i, o, u — treating capitals and lowercase the same.
Lowercase the string first with s.lower() so you only have five letters to check. The expression ch in "aeiou" is True when ch is one of them.
Conte as vogais
Conte quantos caracteres de uma string são vogais — a, e, i, o, u — tratando maiúsculas e minúsculas como iguais.
Minimize a string primeiro com s.lower() para ter apenas cinco letras para verificar. A expressão ch in "aeiou" é True quando ch é uma delas.
Write count_vowels(s): return how many letters in s are vowels (a, e, i, o, u), case-insensitive. · Escreva count_vowels(s): retorne quantas letras em s são vogais (a, e, i, o, u), sem diferenciar maiúsculas/minúsculas.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.