Question: I know this is simple, but I've been searching for about an hour and was unable to find a good answer. I know there has to be something more elegant than iterating through the keys to look for matches and then adding the values.

What I have is:

```
test_dict = [{'Bob':2}, {'Jane':1}, {'Marco':1}, {'Suzy':2}, {'Bob':1},{'Mark':3}, {'Ellen':1}, {'Suzy':1}]

```

What I want to do is add the values together when the keys match (in this case Bob and Suzy). This would eliminate the duplicate keys by adding their values together. It would look like:

```
test_dict = [{'Bob':3}, {'Jane':1}, {'Marco':1}, {'Suzy':3},{'Mark':3}, {'Ellen':1}]

```

What I have tried is:

```
from collections import Counter
final = Counter(test_dict)

```

As well as other collections module items. I'd really prefer not to loop through the dictionary to compare each key for a match and then add the values together. This seems like a really inefficient idea but I can't think of (or find) anything else.

Answer: 
You were on the right track with `Counter`:

```
>>> sum((Counter(d) for d in test_dict), Counter())
Counter({'Bob': 3, 'Ellen': 1, 'Jane': 1, 'Marco': 1, 'Mark': 3, 'Suzy': 3})

```

To do the same with an explicit loop would be like:

```
>>> counter = Counter()
>>> for dict_ in test_dict:
...     counter.update(**dict_)
...     
>>> counter
Counter({'Bob': 3, 'Ellen': 1, 'Jane': 1, 'Marco': 1, 'Mark': 3, 'Suzy': 3})

```
You can also use `defaultdict`, where you extract each key and value form `test_dict` and add it to the defaultdict which takes care of instantiating keys that do not yet exist.

```
from collections import defaultdict

dd = defaultdict(int)
for d in test_dict:
    dd[d.keys()[0]] += d.values()[0]

>>> dd
defaultdict(int,
            {'Bob': 3,
             'Ellen': 1,
             'Jane': 1,
             'Marco': 1,
             'Mark': 3,
             'Suzy': 3})

```