transpose a matrix using list comprehension

42

transpose a matrix using list comprehension -

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]

Comments

Submit
0 Comments