Skip to content

How to find the highest number in a dictionary in Python?

scores = {'Anand' : 5,
          'Arthi' : 2,
          'Subash' : 4}
print(max(income, key=scores.get))
scores = {'Anand' : 5,
          'Arthi' : 2,
          'Subash' : 4}

all_values = scores.values()
max_value = max(all_values)
See also  HashTables: IceCreamParlor - Hackerrank Challenge - Java Solution

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.