Hi,

I am a complete newbie to python.

 

I read that an assignment with an = on lists does not make a copy. Instead,
assignment makes the two variables point to the one list in memory. For
instance, if a = [1, 2, 3] and b=a, then b = [1, 2, 3]. 

 

However, I discovered that if I change the value in 'a',  'b' does not take
the new value.  I thought since it is pointing to the same storage as 'a',
'b' should take the new value.

 

Any explanation would be appreciated.

 

Ayo

 

_________________________________

Desire, Dedication, Determination 

and a little bit of Talent

 

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to