Python programming Flashcards

(1 cards)

1
Q

How to transpose a matrix?

A

def transpose_matrix(a: list[list[int|float]]) -> list[list[int|float]]:
return [list(i) for i in zip(*a)]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly