Thanks for helping out. I am working in python.
I’m requesting a json page, and loading it.
fooList = json.load(urllib.urlopen(
"https://path.to.json.com/request?"))
It looks something like this:
{
"data": [
{
"foo": "2323582"
},
{
"foo": "32689023"
},
{
"foo": "125815512"
},
{
"foo": "1252015"
},
{
"foo": "12518505"
},
{
"foo": "109251907590"
},
{
"foo": "2158019258"
},
{
"foo": "2198059018"
}
]
}
I have a defined object
obj = 1252015
I then want to iterate through that list, and present a boolean answer as to whether or not obj exists in fooList
findObj = 'This is where I need help'
Intended result:
print findObj
True
anyaccepts any generatorg=<generator>which returns boolean values, and is equivalent tog[0] or g[1] or g[2] or ... or g[N]. Of course if you didn’t just want to searchyourJson['data'], that would be a different story, and you’d want to define a recursive function.