a guest Apr 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import itertools
- def flatten(seq):
- if isinstance(seq, list):
- return list(itertools.chain.from_iterable(map(flatten, seq)))
- return [seq]
RAW Paste Data