Skip to content

Instantly share code, notes, and snippets.

@marian556
Last active December 12, 2016 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marian556/0d3b4bb1f679f711d40ea3c7c8a36fed to your computer and use it in GitHub Desktop.
Save marian556/0d3b4bb1f679f711d40ea3c7c8a36fed to your computer and use it in GitHub Desktop.
flatten
def flatten(a):
out=[]
for el in a:
if type(el) is list:
out.extend(flatten(el))
else:
out.append(el)
return out
@marian556
Copy link
Author

It is in Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment