Answer the question
In order to leave comments, you need to log in
How to get object value from json?
{
"0": {
"bar": "test0"
},
"1": {
"bar": "test1"
},
"2": {
"bar": "test2"
}
}
import json
with open('test.json') as json_file:
data = json.load(json_file)
for item in data:
print(item['bar'])
import json
with open('test.json') as json_file:
data = json.load(json_file)
for item in data:
for test in item:
print(test)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question