Flatten a list: Difference between revisions

Line 2,114:
flatten(e, results) # flatten that sublist, appending results to "results"
else: # if element is not a list, then
results.append(xe) # insert a copy of it at the end of "results"
return results
 
Anonymous user