Using Python’s max to return two equally large values

Idea is to find max value and get all keys corresponding to that value:

count = {'a': 120, 'b': 120, 'c': 100}

highest = max(count.values())

print([k for k, v in count.items() if v == highest])

Leave a Comment