I have two dictionaries of tuples, and in the end I need one dictionary with the tuples merged. I am wondering what is the most efficient way to achieve this task.
dict1 = {'a': (1, 2, 3),
'b': (2, 3, 4),
'c': (3, 4, 5)
'd': (6)}
dict2 = {'a': (2, 1),
'b': (3),
'c': (5, 4)}
merged = merge_function(dict1, dict2)
Expected result:
merged = {'a': (1, 2, 3, 2, 1),
'b': (2, 3, 4, 3),
'c': (3, 4, 5, 4, 3),
'd': (6)}