3 ms·
They get overwritten by the value of the dictionary that came last. >>> dict1 = {"key1": 1, "key2": "hello", "key3": [1, 2, 3]} >>> dict2 = {key1": 1, "key
by Kpourdeilami 9y ago
They get overwritten by the value of the dictionary that came last.
>>> dict1 = {"key1": 1, "key2": "hello", "key3": [1, 2, 3]}
>>> dict2 = {key1": 1, "key2": "world", "key3": [1, 4], "key4": "4"}
>>> {**dict1, **dict2}
{'key1': 1, 'key2': 'world', 'key3': [1, 4], 'key4': '4'}
- ericfrederich 9y agoLots of code to show that. How 'bout this: ;-) >>> {**{'a': 'first'}, **{'a': 'second'}} {'a': 'second'}