pihta24

Транспонирование

Feb 2nd, 2021
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. def transpose(matrix):
  2.     out = []
  3.     for i in range(len(matrix[0])):
  4.         t = []
  5.         for j in range(len(matrix)):
  6.             t.append(matrix[j][i])
  7.         out.append(t)
  8.     matrix.clear()
  9.     matrix.extend(out)
Advertisement
Add Comment
Please, Sign In to add comment