data = {'items':[{'link':'xxx'}, {'link':'yyy'}, {'link':'zzz'}]}
上面的dict()对象有一个dict()对象的内部数组作为值或键'items'.
为了获得这个值,data["items"]工作,而为了解析数组中的元素,[0]['link']工作
["items"] get the value of 'items' key # O/P [{'link':'xxx'}, {'link':'yyy'}, {'link':'zzz'}]
["items"][0] first index of the array # O/P {'link':'xxx'}
["items"][0]['link'] key of the first index #O/P 'xxx'
上面的dict()对象有一个dict()对象的内部数组作为值或键
'items'.
为了获得这个值,
data["items"]
工作,而为了解析数组中的元素,[0]['link']
工作我要感谢你的勇气,你提出了一个基本的问题,许多人迟疑问和不及格,在不久的将来
干杯
相关问题 更多 >
编程相关推荐