so I have a dictionary which looks like this:
foo_dict = {'A' : 0.03, 'B' : 0.13, 'C' : 0.42, 'D' : 0.42}
And I got the maximum value with this line :
max_value = max(foo_dict.values())
As you see, the maximum value is 0.42 and there are two keys with that value-C and D. Now I want to get both C and D in a list. I've tried
max_key = max(foo_dict.keys(), key=lambda k : foo_dict[k])
But it only gives C. How do I get both(all) keys that have the same value that is max_value
?
Thanks.