【发布时间】:2018-05-30 09:12:04
【问题描述】:
我有一个 json 文件,看起来像:
{
"ancestors": [
{
"subcategory": [
{
"key": "city",
"name": "City"
}
],
"name": "Da Lat"
},
{
"subcategory": [
{
"key": "province",
"name": "Province"
}
],
"name": "Lam Dong Province"
},
{
"subcategory": [
{
"key": "country",
"name": "Country"
}
],
"name": "Vietnam"
}
],
}
问题是我需要访问其键为省的子类别的名称。
这里我要访问“林同省”
我不知道如何上一层并检查条件。
【问题讨论】:
标签: python json python-3.x dictionary