Published
- 1 min read
transpose a matrix using list comprehension
The solution for this is noted below
transpose a matrix using list comprehension
Solution
MT = [[0,0,0], [0,0,0], [0,0,0]]
for ir in range(3):
for ic in range(3):
MT[ic][ir] = M[ir][ic]
Try other methods by searching on the site. That is if this doesn’t work