Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Count all the vowels in the name and show count of each of them
from collections import Counter
name = "Aashish Chaubey"
vowels = "aeiou"
vowels_list = list(filter(lambda x: x in vowels, name.lower()))
print(f"Number of vowels in name is: {len(vowels_list)}")
print(dict(Counter(vowels_list)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment