Created
May 1, 2018 23:25
-
-
Save messiest/9ba788a2e7b90df006cbec2f4c49d624 to your computer and use it in GitHub Desktop.
Splicing lists in python
This file contains 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 list_splice(*args): | |
out = [None] * (sum(len(i) for i in args)) | |
for i, l in enumerate(args): | |
out[i::len(args)] = l | |
return out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment