How would I merged nested dictionaries in a list in python?
Posted
by Kevin
on Stack Overflow
See other posts from Stack Overflow
or by Kevin
Published on 2010-04-15T15:05:51Z
Indexed on
2010/04/15
15:33 UTC
Read the original article
Hit count: 367
for example if i had the result
[{'Germany': {"Luge - Men's Singles": 'Gold'}},
{'Germany': {"Luge - Men's Singles": 'Silver'}},
{'Italy': {"Luge - Men's Singles": 'Bronze'}}]
[{'Germany': {"Luge - Women's Singles": 'Gold'}},
{'Austria': {"Luge - Women's Singles": 'Silver'}},
{'Germany': {"Luge - Women's Singles": 'Bronze'}}]
[{'Austria': {'Luge - Doubles': 'Gold'}},
{'Latvia': {'Luge - Doubles': 'Silver'}},
{'Germany': {'Luge - Doubles': 'Bronze'}}]
how would I sort this so that all of the events germany and so on had won could be under one single title. i.e germany would be germany:Luge - Men's Singles: Gold, Silver, Luge - Women's Singles: Gold, Bronze, Luge - Doubles: Bronze.
thanks for any help
© Stack Overflow or respective owner