Vowel Count()-其他
Vowel Count()
DESCRIPTION:
Return the number (count) of vowels in the given string.
We will consider , , , , as vowels for this Kata (but not y).
a
e
i
o
u
The input string will only consist of lower case letters and/or spaces.
Solution
def getCount(inputStr):
return sum(1 for let in inputStr if let in "aeiouAEIOU")
————————
DESCRIPTION:
Return the number (count) of vowels in the given string.
We will consider , , , , as vowels for this Kata (but not y).
a
e
i
o
u
The input string will only consist of lower case letters and/or spaces.
Solution
def getCount(inputStr):
return sum(1 for let in inputStr if let in "aeiouAEIOU")