How can I count the length of list. I have following file
[0 1 2]
[0 1 2]
[0]
[0 1 2]
[0 1 2]
[0]
In above example the first list should print 3 and so on
How can I count the length of list. I have following file
[0 1 2]
[0 1 2]
[0]
[0 1 2]
[0 1 2]
[0]
In above example the first list should print 3 and so on
Assuming your entire JSON string is in proper format (e.g. I didn't check it all since it's pretty long) you can load it like this:
import json
json_data=open('json_data')
data = json.load(json_data)
print(data)
json_data.close()
And then to reference different parts of the JSON like so:
data["resouceId"]
data["properties"]["title"]
# etc...
If you want to get all the resourceId
then you can try something like:
for key, value in data.items():
if key == "resourceId":
print(value)