x = {'a': 1, 'b': 2}
y = {'b': 3, 'c': 4}
}z = x.update(y)
def merge_dicts(*dicts):
result = {}
for d in dicts:
for k,v in d.items():
if k in result:
if not isinstance(result[k], list):
result[k], t = list(), result[k]
result[k].append(t)
result[k].append(v)
else:
result[k] = v
return result
z = merge_dicts(x, y)