programming-examples/python/Dictionary/Python script to merge two Python dictionaries.py

5 lines
101 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
d1 = {'a': 100, 'b': 200}
d2 = {'x': 300, 'y': 200}
d = d1.copy()
d.update(d2)
print(d)