Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Yield from solution in Clear category for Flatten a List by maxalex324
def flat_list(nested, isatom=lambda s: isinstance(s, int)):
for (item) in nested:
if isatom(item):
yield item
else:
yield from flat_list(item)
June 6, 2020