|Count Vowels
All Challenges

Count Vowels

EasyStrings

Given a string s, return the number of vowels it contains.


Vowels are: a, e, i, o, u — count both uppercase and lowercase.


You are building a basic text analysis tool and need to count how often vowels appear in user-submitted content.

Examples

Input: count_vowels("hello")
Output: 2
"e" and "o"
Input: count_vowels("Python")
Output: 2
"y" is not a vowel here
Input: count_vowels("AEIOU")
Output: 5
All uppercase vowels count
Input: count_vowels("rhythm")
Output: 0
No vowels

Constraints

  • 0 <= len(s) <= 10,000
  • String may contain any printable characters
pythoneditor
Loading Python runtime…