Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Flatten a List by nomis517
def flat_list(array):
new_list = []
for elem in array:
if isinstance(elem,list):
new_list.extend(flat_list(elem))
else:
new_list.append(elem)
return new_list
Feb. 16, 2020
Comments: