Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # sq_angle_rotate_grid.py
- matrix = [ (1,2,3),
- (4,5,6),
- (7,8,9)]
- rotate_clockwise = zip(*matrix[::-1])
- counterclockwise = zip(*matrix)[::-1]
- rotate_half_turn = [i[::-1] for i in matrix[::-1]]
- for array in [matrix,rotate_clockwise,counterclockwise,rotate_half_turn]:
- for row in array:
- print row
- print
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement