SHARE
TWEET

Untitled

a guest Apr 22nd, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import itertools
  2. def flatten(seq):
  3.     if isinstance(seq, list):
  4.         return list(itertools.chain.from_iterable(map(flatten, seq)))
  5.     else:
  6.         return [seq]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top