Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """ This is a function that returns the count of
- vowel characters in a string"""
- # The function is named vowel_count and it accepts a single argument
- def vowel_count(string):
- # Converting string argument to lower case
- lowercase = string.lower()
- # Searching and Counting the vowel characters in the lowercase version of the string
- # The \ sign is merely for continuation
- counter = lowercase.count("a") + lowercase.count("e") + lowercase.count("i")\
- + lowercase.count("o") + lowercase.count("u")
- # Returning the count after the traversing
- return counter
- # Function Invocation
- print(vowel_count("Estate"))
- print(vowel_count("helicopter"))
- print(vowel_count("ssh"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement