Trying to analyse some strings and compute the number of times they come up. This data is stored in a dictionary. If I were to use the max function only the first highest number encountered would be printed.
count = {"cow": 4, "moo": 4, "sheep": 1}
print(max(count.keys(), key=lambda x: count[x]))
cow
This would yield cow to be the max. How would I get "cow" and "moo" to both be printed
count = {"cow": 4, "moo": 4, "sheep": 1}
cow, moo