Transposing rows into columns assumes a decision about uneven rows. Ordinary zip stops at the shortest input.
Worked example
matrix = [[1, 2, 3], [4, 5, 6]]
print(list(zip(*matrix)))Result
[(1, 4), (2, 5), (3, 6)]Implementation notes
A transposed zip is an iterator of tuples. Materialize it only when repeated traversal or indexed access is part of the consumer's contract.
Try it yourself
Try a missing trailing cell, then decide between strict validation and padding.
Open the Python example →Editorial date September 26, 2026 · Published December 6, 2026