Advertisement
Peaser

vowel counter

Sep 13th, 2014
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. from collections import Counter
  2. def vowelcount(word):
  3.     return sum(dict([i for i in dict(Counter(word.lower())).items() if i[0] in 'aeiou']).values())
  4.  
  5.  
  6. #alternatively
  7. import re
  8. vk = lambda w: len(re.sub('[^aeiouAEIOU]| ','',w))
  9.  
  10.  
  11.  
  12.  
  13. print vowelcount("HOLY SHIT IN THE NAME OF DICKS")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement