Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Recursion solution in Clear category for Flatten a List by vit.aborigen
def flat_list(array):
collected = []
for item in array:
if isinstance(item, list):
collected.extend(flat_list(item))
else:
collected.append(item)
return collected
Oct. 5, 2018
Comments: