Count the vowels · 母音の数を数える
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
This one builds on a lesson you haven't finished yet. Do that lesson first: · これはまだ完了していないレッスンの先にある内容です。まずはそのレッスンを済ませてください:
Python Basics · Functions →
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.
Write count_vowels(s): return how many letters in s are vowels (a, e, i, o, u), case-insensitive. · count_vowels(s) を書いて、s 内の母音(a, e, i, o, u)の数を返してください(大文字・小文字を区別しない)。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。