I have a python dictionary as follows
test={}
test['key1']={}
test['key1'] ['key2'] = {}
test['key1']['key2']['key3'] = 'val1'
test['key1']['key2']['key4'] = 'val2'
I have another dictionary as follows
check = {}
check['key1']={}
check['key1'] ['key2'] = {}
check['key1']['key2']['key5'] = 'val3'
check['key1']['key2']['key6'] = 'val4'
I want to combine this dictionary so i done the following
test.update(check)
but if i do this when i try to print test dictionary it is printing like
{'key1': {'key2': {'key5': 'val3', 'key6': 'val4'}}}
but expected output is
{'key1': {'key2': {'key3': 'val1', 'key4': 'val2','key5': 'val3', 'key6': 'val4'}}}