With the help of
matrix.sort() method, we are able to sort the values in a matrix by using the same method.
Return : Return a sorted matrix
Example #1 :
In this example we are able to sort the elements in the matrix by using
[[ 1 4] [ 3 12]]
Example #2 :
[[ 1 4 9] [ 1 3 12] [ 4 5 6]]
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.