Skip to content

Instantly share code, notes, and snippets.

@kamipo
Created April 7, 2009 12:34
Show Gist options
  • Save kamipo/91212 to your computer and use it in GitHub Desktop.
Save kamipo/91212 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
list = ['hoge','fuga','buzz','foo','hoge','hoge','buzz'];
dict = {}
for value in list:
dict[value] = dict[value] + 1 if dict.get(value) else 1
print dict;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment