dictionary add values for the same keys

Viewed 14964

I have a list of dictionary:

[{'name':'Jay', 'value':'1'},{'name':'roc', 'value':'9'},{'name':'Jay', 'value':'7'},{'name':'roc', 'value':'2'}]

I want it to be:

[{'name':'Jay', 'value':'8'},{'name':'roc', 'value':'11'}]

I tried looping through but I am not able to find an example where I can do this. Any hint or idea will be appreciated.

7 Answers
Related