Aug-29-2019, 05:22 AM
(Aug-29-2019, 01:06 AM)jefsummers Wrote: You have reassigned what a points to, so a no longer is b. Here's a longer interchange that might make it more clear.
>>> a=3 >>> b=a >>> a is b True >>> c = 4 >>> a = c >>> c is a True >>> a is b False >>>When a is reassigned to c it is no longer linked to b.
Reminds me of quantum entanglement ;^).
In Python, all the variables are holding the reference of memory object. When a is 3 and a=b mean, a and b are pointing to same memory location where we stored value 3 and when a is assigned to new value (say 4), it changes its memory reference from value 3 to 4. However memory reference of value 3 is still valid for variable b and assigning another reference to variable 'a' won't make any change in variable 'b' reference