Let\'s take:
l = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
The result I\'m looking for is
r = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
matrix = [[1,2,3],
[1,2,3],
[1,2,3],
[1,2,3],
[1,2,3],
[1,2,3],
[1,2,3]]
rows = len(matrix)
cols = len(matrix[0])
transposed = []
while len(transposed) < cols:
transposed.append([])
while len(transposed[-1]) < rows:
transposed[-1].append(0)
for i in range(rows):
for j in range(cols):
transposed[j][i] = matrix[i][j]
for i in transposed:
print(i)