1def mergeDict(dict1, dict2):
2 ''' Merge dictionaries and keep values of common keys in list'''
3 dict3 = {**dict1, **dict2}
4 for key, value in dict3.items():
5 if key in dict1 and key in dict2:
6 dict3[key] = [value , dict1[key]]
7
8 return dict3
9
10# Merge dictionaries and add values of common keys in a list
11dict3 = mergeDict(dict1, dict2)
12
13print('Dictionary 3 :')
14print(dict3)
15