Find and shows the highest record of the name list

We can use operator.itemgetter

import operator
stats = {'Dave':179, 'Adam':180, 'Daniel': 170}
max(stats.items(), key=operator.itemgetter(1))

Leave a Comment