【发布时间】:2023-03-30 08:46:01
【问题描述】:
当 2 在字典中时,我如何查找与一个人的“姓名”相关联的“id”?
user = 'PersonA'
id = ? #How do I retrieve the 'id' from the user_stream json variable?
json,存储在名为“user_stream”的变量中
[
{
'name': 'PersonA',
'id': '135963'
},
{
'name': 'PersonB',
'id': '152265'
},
]
【问题讨论】:
标签: python json dictionary