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  Java 1D Array (Part 2) - Hackerrank Challenge - Java Solution

Leave a Reply

Your email address will not be published. Required fields are marked *

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