Answers for "how to rotate 2d matrix python 90 degrees"

1

rotate 2d array

#clockwise:
rotated = list(zip(*original[::-1]))
#counterclockwise:
rotated_ccw = list(zip(*original))[::-1]
Posted by: Guest on July-26-2021

Code answers related to "how to rotate 2d matrix python 90 degrees"

Browse Popular Code Answers by Language