In Python 3.5 or greater:
z = {**x, **y}
In Python 2, (or 3.4 or lower) write a function:
def merge_two_dicts(x, y):
z = x.copy() # start with x's keys and values
z.update(y) # modifies z with y's keys and values & returns None
return z
and now:
z = merge_two_dicts(x, y)
This way you can merge dictionaries in Python. Hope it helps. Please post if there are any other queries.