Python program to Merge Two Dictionaries

dict_1 = {1: 'a', 2: 'b'}
dict_2 = {2: 'c', 4: 'd'}
print(dict_1 | dict_2)

OUTPUT:

{1: 'a', 2: 'c', 4: 'd'}

Leave a Comment