SyntaxFix
Write A Post
Hire A Developer
Questions
I hope this will be even more elegant way of doing it.
a = [1,2,3,4,5,6] zip(a[::2], a[1::2]) [(1, 2), (3, 4), (5, 6)]