Skip to content

Instantly share code, notes, and snippets.

@aashish-chaubey
Created August 6, 2022 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aashish-chaubey/e0809deec5833d9ebcd0565710cbb277 to your computer and use it in GitHub Desktop.
Save aashish-chaubey/e0809deec5833d9ebcd0565710cbb277 to your computer and use it in GitHub Desktop.
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