Skip to content

Instantly share code, notes, and snippets.

@WEBMAMOFFICE
Last active February 23, 2018 12:30
Show Gist options
  • Save WEBMAMOFFICE/8577ad02892ee6e23f225bd977e4fa53 to your computer and use it in GitHub Desktop.
Save WEBMAMOFFICE/8577ad02892ee6e23f225bd977e4fa53 to your computer and use it in GitHub Desktop.
# python 3.x version
# pip install more_itertools - if not installed
import more_itertools
youlist = [[1, 2, [3]], 4]
res = list(more_itertools.collapse(youlist))
print(res)
@WEBMAMOFFICE
Copy link
Author

Using Lists operations with more_itertools module

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