Last active
March 31, 2017 06:57
-
-
Save milesrout/b0c344b3ab68873d3f8c9ce19f4579f4 to your computer and use it in GitHub Desktop.
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 intersperse(z, d): | |
q = [x for y in z for x in [y, y]] | |
q[1::2] = [d for x in z] | |
return q[:-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment