Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
generator solution in Clear category for Flatten a List by juzzuj
def f(l):
for el in l:
if isinstance(el, list): yield from f(el)
else: yield el
def flat_list(a):
return list(f(a))
June 4, 2015