Write a function to compute the transpose of a given matrix. The transpose flips a matrix over its diagonal, switching rows and columns.
def transpose_matrix(a: list[list[int|float]]) -> list[list[int|float]]:
rows = len(a)
cols = len(a[0])
return [[a[r][c] for r in range(rows)] for c in range(cols)]c in the original, build a new row by collecting element a[r][c] for every row index r.