Skip to content

Instantly share code, notes, and snippets.

@jorgebastida
Created August 15, 2013 11:14
Show Gist options
  • Save jorgebastida/6240067 to your computer and use it in GitHub Desktop.
Save jorgebastida/6240067 to your computer and use it in GitHub Desktop.
>>> import collections
>>> mydict = collections.defaultdict(list)
>>> mydict["hello"].append("world")
>>> mydict
defaultdict(<type 'list'>, {'hello': ['world']})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment