python - Outputting dictionary results for all indexes -
i'm bit new python, please bare me. i'm trying output keys, indexes, e.g:
print results["result"][0]["name"]
prints out first key no problems, , [1], [2], etc. want able print indexes, value "name". i'm sure uses loop, , tried several methods, have failed.
how can print results indexes, not 1?
assuming results['result']
is a list
, use for
loop iterate on items in list:
for item in results['result']: print(item['name'])
Comments
Post a Comment