transpose(matrix) that returns the transpose of a rectangular 2D list matrix (rows become columns), computed with nested for loops (do not use zip(*matrix)).transpose([[1, 2, 3], [4, 5, 6]])
[[1, 4], [2, 5], [3, 6]]
Row/column indices swap.
If the original has R rows and C columns, the transpose has C rows and R columns.
For each column index j, build a new row by collecting matrix[i][j] across all i.