title | description | author | tags |
---|---|---|---|
Count Vowels |
Counts the number of vowels in a string. |
SteliosGee |
string,vowels,count |
def count_vowels(s):
vowels = 'aeiou'
return len([char for char in s.lower() if char in vowels])
# Usage:
count_vowels('hello') # Returns: 2