Advertisement
VanoHa

matrix transposition

Jun 28th, 2023
946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. from icecream import ic
  2.  
  3. n = '''1 2 3
  4. 4 5 6
  5. 7 8 9
  6. 5 4 3'''
  7.  
  8. n1 = [ic([j for j in i.split()]) for i in n.split('\n')]
  9.  
  10. # for x in range(len(n1[0])):
  11. #     ic([n1[row][x] for row in range(len(n1))])
  12.  
  13. print(*[[n1[row][x] for row in range(len(n1))] for x in range(len(n1[0]))])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement