Skip to content

Instantly share code, notes, and snippets.

@wavebeem
Created January 14, 2011 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wavebeem/779230 to your computer and use it in GitHub Desktop.
Save wavebeem/779230 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
# Python
# lolz
occurences = {}
string = raw_input('string> ')
for character in string:
occurences[character] = occurences.get(character, 0) + 1
for character, occurence in occurences.iteritems():
print character, '=>', occurence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment