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