I am trying to parse a JSON file which is of the following format
[
{
"name":"name1",
"age":"age1"
},
{
"name":"name2",
"age":"age2"
},
{
"name":"name3",
"age":"age3"
}
]
When I use the JSON parser in python I am getting the following error:
> ValueError: No JSON object could be decoded
Here is my code :
import json
with open('sample.json') as data_file:
data = json.load(data_file)
print(data)