indexing a list with nth depths
hi i am trying to make a function that can index a list and its sublists and provide their indices. example - [2, [3,4,5,[6,[7],8] ,[9], 10. . .] so that if it hits a nested list it can output its indices somehow as well. some sample outputs- number | index 2 , (0) 3 , (1) 4 , (1,1) 5, (1,2) or index | number ive tried recursion and its successful but i dont know how to grab their respective indices as a return. just wondering how other humans deal with a problem like this. UPDATE --------------------- in my original problem i was asking about enumerating indices but i think i didnt give enough information. in my hypothetical the indices could be used to 'backtrack' through the master list. so if i wanted 88 from this list a = [2,[3,4,5],[8,[5,6,[88],7],9,10],11,[12,13,[14,15,],28]] i would be able to get a[2][1][2] as 88. maybe is this the wrong way to do it? ( considering if the list goes too many depths down) as always thanks for your time -R https://code.sololearn.com/c3SA3saJpN2n/?ref=app