I have a data structure like this (the actual lists of lists are very long and of varying depth). I do know their depth beforehand.
a=( [1,2], [2,3,[4,5]] )
b=( [[1,2],[2,3]] )
A want to loop through each single list. How to best do this?
I don't want to end up doing something like this:
for l in a:
if instance(l, list):
for ll in l:
if instance(ll, list):
...