Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 288 Bytes

count-vowels.md

File metadata and controls

15 lines (13 loc) · 288 Bytes
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