I have a json data which has another json data as its values. I want to change the value of a key. Key is given with separator dot(.)
import json
data1='{"name":"xxx","info":{"mark":{"sub1":"11","sub2":22,"sub3":{"sub31":22,"sub32":44}}},"avg":33.33}'
data=json.loads(data1)
key="info.mark.sub3.sub32"
value=98
How can i change the value of the key without doing like this data["info"]["mark"]["sub3"]["sub32"]=value
?