I want to construct a dict in Python which with json.dumps(arg) will convert to the following JSON structure:
"{"type":"id",
"entries:":
[["a",91],
["b",65],
["c",26],
["d",25]]}"
This is what I have so far:
json_dict = {'type': str("id"),
'entries': [['a': "91"], #Error line
['b': "65"],
['c': "26"],
['d': "25"]]}
I am getting "invalid syntax" error on the line which is marked with #Error line. How can I represent this hierarchical structure in a dict and still be able to convert it to the desired JSON structure?
See Question&Answers more detail:os