Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Recursion + extend() solution in Clear category for Flatten a List by evarome10
def flat_list(array):
result = []
for i in array:
if not isinstance(i, list):
result.append(i)
else:
result.extend(flat_list(i))
return result
Feb. 14, 2019