Count the vowels · عد الحروف المتحركة
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.
عد الحروف المتحركة
احسب عدد أحرف المتغيرات (vowels) في السلسلة النصية — a، e، i، o، u — مع اعتبار الأحرف الكبيرة والصغيرة متساوية.
حول السلسلة إلى أحرف صغيرة باستخدام s.lower() أولاً لتصبح لديك خمسة أحرف فقط للتحقق منها. التعبير ch in "aeiou" يساوي True عندما يكون ch واحداً منها.
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. · اضغط تشغيل لرؤية المخرجات هنا.