I have a list of tuple and want to make JSON from it
[(1, 'a', 'A'), (2, 'b', 'B'), (3, 'c', 'C'), (4, 'd', 'D'), (5, 'e', 'E'), (6, 'f', 'F'), (7, 'g', 'G'), (8, 'h', 'H'), (9, 'i', 'I')]
And Expected JSON
{
"List": [
{
"name": "1",
"description": "a",
"type": "A"
},
{
"name": "2",
"description": "b",
"type": "B"
},
{
"name": "3",
"description": "c",
"type": "C"
},
and so on....
]
}
How can i do that?
The duplicate identified answers didn't work and gave this error
ValueError: dictionary update sequence element #0 has length 3; 2 is required