Last active
December 12, 2016 10:48
-
-
Save marian556/0d3b4bb1f679f711d40ea3c7c8a36fed to your computer and use it in GitHub Desktop.
flatten
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(a): | |
out=[] | |
for el in a: | |
if type(el) is list: | |
out.extend(flatten(el)) | |
else: | |
out.append(el) | |
return out | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is in Python