【发布时间】:2018-02-07 00:18:48
【问题描述】:
我正在尝试从以下字典中访问 creator 的值以及描述和电子邮件等其他值。
我尝试将其转换为 json,然后访问密钥。但它没有用。是迭代整个字典并获取所有键值的唯一方法。
任何建议都会很棒!!
{
"description": xxx,
"email": xxx@scotiabank.com,
"creator": {
"data": [
{
"name": "john"
"id": "123"
},
{
"name": "victor"
"id" : "345"
}
]
}
【问题讨论】:
-
您应该展示您的尝试并解释“无效”的含义。
-
不会是
dictionary["creator"]["data"]吗?
标签: python dictionary