1a_dictionary = {"a": 1, "b": 2, "c": 3}
2
3# get key with max value
4max_key = max(a_dictionary, key=a_dictionary.get)
5
6print(max_key)
1# Basic syntax:
2key_with_max_value = max(dictionary, key=dictionary.get)
3
4# Note, to get the max value itself, you can do either of the following:
5max_value = dictionary[max(dictionary, key=dictionary.get)]
6max_value = max(dictionary.values())
7
8# Example usage:
9dictionary = {"a": 1, "b": 2, "c": 3}
10max(dictionary, key=dictionary.get)
11--> 'c'
1import operator
2stats = {'a':1000, 'b':3000, 'c': 100}
3max(stats.iteritems(), key=operator.itemgetter(1))[0]