In a 2d matrix, I want to reverse each row in matrix without changing order of rows.
example: I have a matrix [[1,2,3], [4,5,6], [7,8,9]]
If i use python reverse function, it becomes [[9,8,7], [6,5,4], [3,2,1]]
Instead my desired result is [[3,2,1], [6,5,4], [9,8,7]]
We can use small code snippet like
row.reverse()
But is there a way to incorporate this in reverse function only? Sorry if this is a dumb question, i am not very good with programming