def transpose_matrix(matrix: list) -> list:
m = len(matrix)
n = len(matrix[0])
result = [[0] * m] * n
for row in range(m):
for col in range(n):
result[col][row] = matrix[row][col]
return result
matrix = [
[1, 2, 3],
[4, 5, 6]
]
transpose_matrix(matrix)
>>> [[3, 6], [3, 6], [3, 6]]
result = [[0] * m] * n
result = [[0] * m for _ in range(n)]