Guest User

Untitled

a guest
Apr 26th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. from collections import Counter
  2. a = ['a','a','b','b']
  3. b = ['b','b','c','d']
  4. c = a+b
  5. cnt = Counter()
  6. for x in c:
  7. cnt[x] +=1
  8.  
  9. print(cnt)
  10. Counter({'a': 2, 'b': 4, 'c': 1, 'd': 1})
Add Comment
Please, Sign In to add comment