Hi, here’s your problem today. This problem was recently asked by Twitter:
Given a matrix, transpose it. Transposing a matrix means the rows are now the column and vice-versa.
Here’s an example:
def transpose(mat):
# Fill this in.
mat = [
[1, 2, 3],
[4, 5, 6],
]
print(transpose(mat))
# [[1, 4],
# [2, 5],
# [3, 6]]