Skip to content

Instantly share code, notes, and snippets.

@alirezaimi
alirezaimi / list-iter
Created May 8, 2013 05:45
simple script
l= [[['ali']], [1, 2, [3],[[[4]]]], [[[[[[2]],[[3]]]]], [34]]]
p= []
def ll(a):
for i in a:
if not isinstance(i, list):
p.append(i)
else:
ll(i)
return(p)
print(ll(l))