1def transpose(matrix):
2 rows = len(matrix)
3 columns = len(matrix[0])
4
5 matrix_T = []
6 for j in range(columns):
7 row = []
8 for i in range(rows):
9 row.append(matrix[i][j])
10 matrix_T.append(row)
11
12 return matrix_T
13