Reputation: 17
Sorry for the confusion this problem can cause you.
I have a dict which keys are country names and values that are lists of dicts, see example below:
{'spain': [{'gold': 3}, {'silver': 1}, {'bronze': 0}], 'colombia': [{'gold': 2}, {'silver': 0}, {'bronze': 0}]}
I need to compare them and get the one that has more gold medals, but I don't know any way of doing it.
PS: I need to return the country with the most medals in the same way as above:
{'country':[{'gold':3}, {'silver':3}, {'bronze':3}]}
Edit: Clarification
Upvotes: 0
Views: 34