JSON data can be looped on its keys and values:
for keys,values in d['hits']['hits'][0].items():
print(keys)
We receive the following output:
Printing keys of the loaded JSON by looping over the keys and values
We can print both the keys and values together as well.
for keys,values in d['hits']['hits'][0].items():
print(keys,values)
We receive the following output:
Printing keys and values of the loaded JSON by looping over the keys and values
Now, we will look at how to use reading and writing operations with exotic file formats.