Advertisement
rfmonk

collection_counter_get_values.py

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