Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Recursive Generator solution in Clear category for Flatten a List (generator version) by flpo
from itertools import chain
def flat_list(x):
if isinstance(x, list):
yield from chain.from_iterable(map(flat_list, x))
else: yield x
Aug. 26, 2018
Comments: