If I have a list like l=[1,2,3,4,5,6]
. If I do something like:
for i in l:
print(i)
It will print all element separately.
1
2
3
4
.
.
.
Is there a way to iterate simultaneously over multiple elements?
For example, if I want to iterate over each 3 elements
for ....:
print(..)
Should print:
1,2,3
4,5,6
So that in each iteration the variable that iterate the for will be a tuple of, in this case, 3 elements.