# Code

def addDict(dic1, dic2):

new_dic = {}

for i in dic1.keys(): # all the keys will be put into the new_dic

new_dic[i] = dic1[i]

for i in dic2.keys(): # keys common in both the dictionaries will have the values of dic2 in the new_dic

new_dic[i] = dic2[i]

return new_dic

dic1 = {‘a’:1, ‘b’:2, ‘c’:3}

dic2 = {‘c’:4, ‘d’:5, ‘e’:6}

print(addDict(dic1, dic2))

# Output

{‘a’: 1, ‘b’: 2, ‘c’: 4, ‘d’: 5, ‘e’: 6}