Created
April 26, 2017 09:22
-
-
Save miodeqqq/048f27c35121b43993114c76bddb7908 to your computer and use it in GitHub Desktop.
Merge flatten lists into the one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flatten(x): | |
""" | |
Merges flatten lists into the one. | |
""" | |
return [a for i in x for a in flatten(i)] if isinstance(x, collections.Iterable) else [x] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment