gyro schrieb:
Hi,
I was writing a Python script to perform some data analyses and was
surprised by some behavior I noted. A simple test program illustrating
the behavior is below.
I do not understand why the value of 'data' is being modified. I am
obviously missing something obvious, and would ce
it's not a scope issue. you are confusing variables and objects.
a variable is a box that can hold an object
so x = 2 puts the object '2' in the box 'x'.
following that with x = '3' changes the box 'x' to hold the object '3'.
but lists are also boxes, different from variables.
so x = [1,2,3]
Hi,
I was writing a Python script to perform some data analyses and was
surprised by some behavior I noted. A simple test program illustrating
the behavior is below.
I do not understand why the value of 'data' is being modified. I am
obviously missing something obvious, and would certainly apprecia