Created
August 15, 2013 12:40
-
-
Save sai-prasanna/6240529 to your computer and use it in GitHub Desktop.
Merge Dictionary and update duplicates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
a = {'a': 1} | |
b = {'a': 2, 'b': 3} | |
c = Counter(a) + Counter(b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment