Skip to content

Instantly share code, notes, and snippets.

@nZac
Created November 2, 2013 19:28
Show Gist options
  • Save nZac/7282543 to your computer and use it in GitHub Desktop.
Save nZac/7282543 to your computer and use it in GitHub Desktop.
Find the largest int in a dictionary
print stats
# {'a': 3, 'c': 1, 'b': 8}
max(stats.iterkeys(), key=lambda key: stats[key])
# 'b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment