Skip to content

Instantly share code, notes, and snippets.

@messiest
Created May 1, 2018 23:25
Show Gist options
  • Save messiest/9ba788a2e7b90df006cbec2f4c49d624 to your computer and use it in GitHub Desktop.
Save messiest/9ba788a2e7b90df006cbec2f4c49d624 to your computer and use it in GitHub Desktop.
Splicing lists in python
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