# merge two dictionaries a = {'apple':1, 'melon': 4} b = {'apple': 2, 'orange': 2,'banana':3} merge_dic = {**a, **b} print(merge_dic) # {'apple': 2, 'melon': 4, 'orange': 2, 'banana': 3} #Python 3.9: # a|b