Skip to content

Instantly share code, notes, and snippets.

@nomeyer
Last active February 10, 2016 20:55
Show Gist options
  • Save nomeyer/ff98e882f7ce988dc5d5 to your computer and use it in GitHub Desktop.
Save nomeyer/ff98e882f7ce988dc5d5 to your computer and use it in GitHub Desktop.
Flatten a list of lists in Python
from itertools import chain
l = [[0, 1], [2, 3]]
l = list(chain.from_iterable(l))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment