I have the following json object in python:
jsonobj = {
"a": {
"b": {
"c": var1,
"d": var2,
"e": [],
},
},
}
我想把键值元素附加到"e"中,但是不知道它的语法.我try 添加以下内容,但没有正确地加上括号和引号:
jsobj["a"]["b"]["e"].append("'f':" + var3)
Instead, I want "e" to be the following:
"e":[
{"f":var3, "g":var4, "h":var5},
{"f":var6, "g":var7, "h":var8},
]
Does anyone know the right way to append to this json array? Much appreciation.