I have 3 lists,
city_id = [1,2,3]
city_name = ['a','b','c']
city_capital = ['x','y','z']
How to combine the above three lists into a json in the below format without iterating over by myself. Is there any library function available in python to get the job done?
[
{
'city_id': 1,
'city_name': 'a',
'city_capital': 'x'
},
{
'city_id': 2,
'city_name': 'b',
'city_capital': 'y'
},
{
'city_id': 3,
'city_name': 'c',
'city_capital': 'z'
}
]