I am trying to traverse each 'node?' of a JSON objet in python. I am trying to implement a recursive function like
def function(data):
for element in data:
--- do something----
if (some condition):
function(element)
what I want to know is how can I find if the element in question is another object or just a string. That is, what should I write instead of 'some condition' in my above code. Like when I travese an XML , I check if it has any children using getchildren() and if it does, I recursively call the function again.....