Simple object reference

AON LAZIO aonlazio at gmail.com
Sat Nov 14 18:25:07 EST 2009


Hi, I have some problem with object reference
Say I have this code

a = b = c = None
slist = [a,b,c]
for i in range(len(slist)):
slist[i] = 5
print slist
print a,b,c

I got this
[5, 5, 5]
None None None

    Question is how can I got all a,b,c variable to have value 5 also?
    Thanks in advance
-- 
Passion is my style
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091114/dce8f4ec/attachment.html>


More information about the Python-list mailing list