I have a tuple (could also use list instead) like this:
(1, 'jsmith', 'Ferrari', '10 million', 39, 16, 2, 0, '-')
What would be a sensible way to represent this as a JSON struct in python? The key is a string like so:
{
"John Smith" : (1, 'jsmith', 'Ferrari', '10 million', 39, 16, 2, 0, '-')
}
Any suggestions? The JSON will be parsed in JS in the front end and will always be the same length. Missing entries are represented by '-'.
json.dumpsdictinto a string representing the JSON?