Hello.
I was programming in python and wanted to do the line switching (between the second and third line) of an array using the following code. But I wanted to know why the variable auxLinha
changes value when I modify b[inicio]
def trocaLinhaB(b,inicio,final):
listaAux = b[inicio]
b[inicio] = b[final]
b[final] = listaAux
The original matrix
0 2 3
0 -3 1
2 1 5
But the result was
[[ 0. 2. 3.]
[ 0. -3. 1.]
[ 0. -3. 1.]]
And I expected the
[[ 0. 2. 3.]
[ 2. 1. 5.]
[ 0. -3. 1.]]