body = {
'a': 1,
'b': 'apple',
'child': [
{
'a': 12,
'b': 'banana',
'child': [
{
'a': 121,
'b': 'mango',
'child': [
{
'a': 1211,
'b': 'coconut',
'child': [dynamic nested]
}
]
},
{
'a': 122,
'b': 'papaya',
'child': [
{
'a': 1221,
'b': 'lemon',
'child': [dynamic nested]
}
]
}
]
},
{
'a': 13,
'b': 'orenge',
'child': [
dynamic nested
]
}
]
}
if i want know index of 'coconut' or 'lemon' (json body dynamic children sub child i don't know dee child, but khow 'a' or 'b' for find index deep)
how to get index with python?
ex1: index of 'coconut' = [0,0,0]
ex2: index of 'lemon' = [0,1,0]