a = {“name”:“123”,“data”:{“result”:[{“src”:“python1”},{“src”:“python2”},{“src”:“python3”}]}}
取出上述字典中的python1/python2/python3
a = {"name": "123",
"data": {"result": [{"src": "python1"}, {"src": "python2"}, {"src": "python3"}]}}
b = a['data']
c = b['result']
for i in c:
print(i['src'])
a = {"name": "123",
"data": {"result": [{"src": "python1"}, {"src": "python2"}, {"src": "python3"}]}}
for num in range(0, len(a['data']['result'])):
print(a['data']['result'][num]['src'])
a = {"name": "123",
"data": {"result": [{"src": "python1"}, {"src": "python2"}, {"src": "python3"}]}}
num = 0
while num < len(a['data']['result']):
print(a['data']['result'][num]['src'])
num += 1