Archived
matrix clockwise rotation
An old note — I haven't updated it since I wrote it.
1m = [[1, 2, 3],
2 [4, 5, 6],
3 [7, 8, 9]]
4
5[*zip(*reversed(m))]
Output:
1[(7, 4, 1),
2(8, 5, 2),
3(9, 6, 3)]
See also:
Archived
1m = [[1, 2, 3],
2 [4, 5, 6],
3 [7, 8, 9]]
4
5[*zip(*reversed(m))]
Output:
1[(7, 4, 1),
2(8, 5, 2),
3(9, 6, 3)]
See also: