I am having some trouble to understand what is happening with the following code:
>>> print(list(zip(*[iter((1,2,3,4,5,6,7,8))]*4)))
[(1, 2, 3, 4), (5, 6, 7, 8)]
>>> print(list(zip(*[iter((1,2,3,4,5,6,7))]*4)))
[(1, 2, 3, 4)]
I suspect it is doing internally something like:
>>> print(list(zip(*((1,5), (2,6), (3,7), (4,8)))))
[(1, 2, 3, 4), (5, 6, 7, 8)]
But I can't understand how this list of iterator multiplied by a constant gives this. Could you clarify this for me?