I have the following json which I am trying to parse into a dictionary so that I get just the queries in the "Queries" that is query 1 and query 2
[
{ "A": "xyz",
"B": "this is xyz",
"Queries": [
"Query 1",
"Query 2"
]
}
]
I am using:
import json
js=open('C://localpath//files.json')
data=json.load(js) //assuming that json.load() will make data as dictionary correct me if i am wrong
data.get("Queries") ives the following error
Traceback (most recent call last): File "", line 1, in AttributeError: 'list' object has no attribute 'get'
How do I get data to be a dictionary and not a list and use "Queries" to just get the queries out of json, I don't want to convert it to a list. Is there a way to directly treat it as a dictionary?