Count the vowels · Hitung huruf vokal
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.
Hitung vokal
Hitung berapa banyak karakter vokal dalam string — a, e, i, o, u — perlakukan huruf kapital dan kecil sama.
Hurufkan semua menjadi lowercase dengan s.lower() agar Anda hanya perlu memeriksa lima huruf. Ekspresi ch in "aeiou" bernilai True ketika ch adalah salah satunya.
Write count_vowels(s): return how many letters in s are vowels (a, e, i, o, u), case-insensitive. · Tulis count_vowels(s): kembalikan berapa banyak huruf dalam s adalah vokal (a, e, i, o, u), tanpa memperhatikan huruf besar/kecil.
Click Run to see the output here. · Klik Jalankan untuk melihat output di sini.