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

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -