Skip to content

Instantly share code, notes, and snippets.

@domluna
Created April 30, 2013 16:23
Show Gist options
  • Save domluna/5489841 to your computer and use it in GitHub Desktop.
Save domluna/5489841 to your computer and use it in GitHub Desktop.
Better way to iterate over dictionaries
for key, val in dictionary.iteritems():
print key, val
for key in dictionary.iterkeys():
print key
for val in dictionary.itervalues():
print val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment