Skip to content

Instantly share code, notes, and snippets.

@wilsotc
wilsotc / flatten.py
Created March 12, 2019 23:57
flatten array function
def flatten( arr, arr2 ):
for ele in enumerate( arr ):
if type(ele[1]) is list:
flatten (ele[1], arr2)
else:
z.append(ele[1])
y = [2,[3,[4,9]],4,[5,6]]
z = []