I have a list [1,2,3,4,5,6]
and I want to iterate over it like
[1,2]
[3,4]
[5,6]
I am able to find a lot of answers using zip()
that result in
[1,2]
[2,3]
[3,4]
[4,5]
[5,6]
and I could create a new list from this and iterate over every 2nd element in that list with [::2]
but I am wondering if there is a more elegant solution.
Thanks for your help.