Skip to content

Instantly share code, notes, and snippets.

@abehmiel
Created May 9, 2017 20:50
Show Gist options
  • Save abehmiel/c343181d8e5b7750059614f06c1ed37f to your computer and use it in GitHub Desktop.
Save abehmiel/c343181d8e5b7750059614f06c1ed37f to your computer and use it in GitHub Desktop.
Get the key with the maximum value in a dictionary
some_dict = {'one': 1, 'two':2, 'three': 3480394803840, 'four': 4}
max_key = max(some_dict, key=some_dict.get)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment