Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Count the vowels · ⁨นับสระ⁩

English

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() เพื่อให้มีเพียงห้าตัวอักษรที่ต้องตรวจสอบ. Expression ch in "aeiou" จะเป็น True เมื่อ ch เป็นหนึ่งในนั้น

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP