Skip to content

Instantly share code, notes, and snippets.

View flatten
def flatten(a):
out=[]
for el in a:
if type(el) is list:
out.extend(flatten(el))
else:
out.append(el)
return out