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.
ספור את התנועות
ספור כמה אותיות במילה הן元音 — 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. · לחץ על הרץ כדי לראות את התוצא כאן.