Practice

Count Vowels

MEDIUMString Processing

Read a word. Output the number of vowels (a, e, i, o, u) it contains. Ignore case.

Input: A single word. Output: The count of vowels.

Example:

Input:  hello
Output: 2

Sample Test Cases

Test 1: hello has 2 vowels
Inputs: hello
Expected: 2
Test 2: programming has 3 vowels
Inputs: programming
Expected: 3
Test 3: No vowels
Inputs: rhythm
Expected: 0

Premium Question

This question needs a paid plan — upgrade, or join a class from a teacher who has one. You can read the description and sample tests, but grading is locked.

Sign in to get started