Advertisement
rfmonk

collection_counter.py

Jan 9th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import collections
  5.  
  6. print collections.Counter(['a', 'b', 'c', 'a', 'b', 'b'])
  7. print collections.Counter({'a': 2, 'b': 3, 'c': 1})
  8. print collections.Counter(a=2, b=3, c=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement