Skip to content

Instantly share code, notes, and snippets.

@domoritz
Created May 1, 2012 17:25
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 domoritz/2569828 to your computer and use it in GitHub Desktop.
Save domoritz/2569828 to your computer and use it in GitHub Desktop.
Haskell's intersperse for python
# http://learnyouahaskell.com/modules
intersperse = lambda e,l: sum([[x, e] for x in l],[])[:-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment