Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

max element in dictionary python

import operator
stats = {'a':1000, 'b':3000, 'c': 100}
max(stats.iteritems(), key=operator.itemgetter(1))[0]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #max #element #dictionary #python
ADD COMMENT
Topic
Name
8+4 =