Created
August 17, 2014 15:27
-
-
Save moshekaplan/013ccf140fa535424d13 to your computer and use it in GitHub Desktop.
Merge Python dictionaries
This file contains hidden or 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
def merge_dicts(*dicts): | |
all_items = [] | |
for dictionary in dicts: | |
all_items += dictionary.items() | |
return dict(all_items) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment