So I'm having this issue where I'm trying to convert something such as
[0]['question']: "what is 2+2",
[0]['answers'][0]: "21",
[0]['answers'][1]: "312",
[0]['answers'][2]: "4"
into an actual formated json object like so
[
{
'question': 'what is 2+2',
'answers': ["21", "312", "4"]
}
]
but I'm not too sure what approach to take to make this work.
I'm planning on parsing the key-values in the first snipped through javascript and decode it into a json object like in the second snippet through python.
Have you got any idea on how to do this? I'd accept an example in pretty much any language as it shouldn't be much of a worry to read the concept behind them.
[0, "question", "xyz"]and[0, "answers", 0, "21"]], think how you'd add this to an empty object, including building up the various paths through the object. That's a good start.