I have a huge List of dictionary like this which has almost 100 entries.
[{ "color":-65536,
"touch_size":0.21960786,
"touch_x":831.25,
"touch_y":1597.2656
},
{ "color":-65536,
"touch_size":0.20392159,
"touch_x":1302.5,
"touch_y":1496.0938
}, .... {}]
I want to insert 2 new keys with values in each dictionary on a particular position.
new_keys = ['touch_x_dp','touch_y_dp']
touch_x_dp
needs to be placed after key touch_x
and touch_y_dp
needs to be placed after touch_y
The values for these need to be initialized with None.
I have tried this but this does not place them where I need.
for key in dp_keys:data['attempts'][i]["items"][j][key]=None