Avatar ·

How to rotate a matrix (two-dimensional array) by 90 degrees using ZIP?

📁 Advanced Python Topics, example, numpy

How to rotate a matrix in one line without Numpy and loops?

For example, if the original matrix:

  [ 1 ,  2 ],  [ 3 ,  4 ]]  

then the resulting should be:

 [ 3 ,  1 ],  [ 4 ,  2 ]]