Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
SumLists solution in Clear category for Flatten a List by DLCstvi4
def flat_list(l):
while any(i for i in l if isinstance(i, list)):
l = sum([i if isinstance(i, list) else [i] for i in l], [])
return [i for i in l if i!=[]]
Oct. 22, 2019
Comments: