[Python] Object spread operator in Python
In JS, we have object spread opreator:
const x = { a: '1', b: '2' } const y = { c: '3', d: '4' } const z = { ...x, ...y } // z = {a: '1', b: '2', c: '3', d: '4'}
In python we can do:
x = {'a': 1, 'b': 2} y = {'b': 3, 'c': 4} z = {**x, **y} // z= {'c': 4, 'a': 1, 'b': 3}