Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # Enter your code here. Read input from STDIN. Print output to STDOUT
  2. string = "% percent of the lowest 1 2 3, for five 9??? WHat the FUCK!"
  3. string = string.lower().split(' ')
  4.  
  5. seen = {}
  6. for i in string:
  7. temp = ''.join(list(filter(lambda x: x.isalpha(), i)))
  8. if temp:
  9. if temp in seen:
  10. seen[temp] += 1
  11. else:
  12. seen[temp] = 1
  13.  
  14.  
  15. for i in sorted(seen.items()):
  16. if not i:
  17. None
  18. else:
  19. print("{0} - {1}; ".format(i[0], i[1] ), end='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement