3
Hello.
I was programming in python and wanted to change the line (between the second and third lines) of an array using the following code. But I wanted to know why the variable auxLinha
changes value when modified 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.]]