导读: 如何在Python中创建嵌套词典列表?不调用API该怎么做?Q 如何在Python中创建一个嵌套词典列表pythonpython-3.x1-我通过API调用获得嵌套词典列表。如何在Python中创建一个嵌套词典列表2-...
如何在Python中创建嵌套词典列表?不调用API该怎么做?
Q 如何在Python中创建一个嵌套词典列表
python
python-3.x
1-我通过API调用获得嵌套词典列表。如何在Python中创建一个嵌套词典列表
2-我需要创建这个列表,而无需调用API。
[{'location': {'latitude': 37.7749295,
'longitude': -122.4194155},
'name': 'san francisco',
'store_id': 1},
{'location': {'latitude': 40.7127837,
'longitude': -74.0059413},
'name': 'new york',
我曾尝试以下:
store_1 = dict()
store_1["store_id"] = 1
store_1["name"] = "san francisco"
store_1["location"] = dict()
store["latitude"] = 37.7749295
store["longitude"] = -122.4194155
store_1["location"] = store
store_2["store_id"] = 2
store_2["name"] = "new york"
转载请注明出处:tokenim钱包官网下载,如有疑问,请联系()。
本文地址:https://shxhpack.com.cn/imzx/1178.html