Answer the question
In order to leave comments, you need to log in
How to determine the number of objects in python json?
Good afternoon! How to determine the number of objects in a json string using the standard library.
For example, there are only 2 below.
{
"firstName": "Ivan",
"lastName": "Ivanov",
}
Thank you!
Answer the question
In order to leave comments, you need to log in
d = {'a':1, 'b':2}
len(d)
s = "{'a':1}"
import json
d = json.loads(s)
len(d)
If the json structure is always like this then inputString.count('": "')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question