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

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -