I have a function that returns a dict as variable that contains 3 elements with index1, index2, index3 and the corresponded value How can I pass those 3 elements and append to exist dict variable without using an additional variable. All I can think of is using extra variable to pass value.
trans = {}
trans = rtn_func()
want['index1'] = trans['index1']
want['index2'] = trans['index2']
want['index3'] = trans['index3']
print(trans)
{ 'index1': 'value1', 'index2': 'value2', 'index3': 'value3', }
print(want)
{ 'o_inx1': 'nv1', 'o_inx2': 'nv4', 'o_inx3': 'nv1', 'index1': 'value1',
'index2': 'value2', 'index3': 'value3', }