Skip to content

Instantly share code, notes, and snippets.

@rbiswas4
Last active December 30, 2016 02:03
Show Gist options
  • Save rbiswas4/68f78cff0876f54b9e2061ce21073b7f to your computer and use it in GitHub Desktop.
Save rbiswas4/68f78cff0876f54b9e2061ce21073b7f to your computer and use it in GitHub Desktop.
pairwise reversing
l = [1, 2, 3, 4]
x = zip(l[1::2], l[::2])
list(e for t in x for e in t)
ll = []
for t in x:
for e in t:
ll.append(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment