Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = {'a': 1, 'b': 2}
- y = {'b': 3, 'c': 4}
- z = {**x, **y}
- z = {}
- for d in list_of_dicts:
- z.update(d)
- >>> a = {1:11}
- >>> b = {2:22}
- >>> c = {3:33}
- >>> list_abc = [a,b,c]
- >>> from collections import ChainMap
- >>> dict(ChainMap(*list_abc))
- {1: 11, 2: 22, 3: 33}
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement