I would do it like this:
>>> fst = {'A': 5, 'B': 6, 'C': 8}
>>> snd = {'A': 4, 'B': 9, 'E': 2}
>>> out = {k: fst[k] + snd[k] for k in fst.keys() & snd.keys()}
>>> out.update({k: fst[k] if k in fst else snd[k] for k in fst.keys() ^ snd.keys()})
>>> out
{'A': 9, 'B': 15, 'C': 8, 'E': 2}
solved How to add two dictionaries [duplicate]