transpose(matrix) that returns the transpose of a rectangular 2D list matrix (rows become columns). Assume all rows have the same length.matrix = [[1, 2, 3], [4, 5, 6]]
[[1, 4], [2, 5], [3, 6]]
Row i, column j moves to row j, column i.
zip(*matrix) transposes rows into columns directly.
Convert each resulting tuple back to a list.