Feb-16-2017, 06:17 PM
(Feb-16-2017, 05:13 PM)merlem Wrote:(Feb-16-2017, 04:45 PM)Felipe Wrote: The idea is use "originT" to store the value of "T" every time that enter in the while. So I can change the value of "T"...
And what happens to the value of "originT" in that moment?
Maybe try a copy instead, it can be done with a minor code change:
originT = T[:]
I tried that and doesn't work. I really don't understand the problem.
I use:
originB = B B = B + cteThem, when I print "originB" and "B" that's ok. These arrays has different values.
But if I use:
originT = T dx = len(T) for i in range(dx): if T[i] >= 0: T[i] = T[i] + cte else: T[i] = T[i] - cteWhen I print "originT" and "T", they have the same value. Why? If change "T" means change "originT", the same would be true for "originB" and "B".