-3

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

abd
  • 73
  • 1
  • 8

1 Answers1

1

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...

Edit

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)
alacy
  • 4,972
  • 8
  • 30
  • 47