On Sat, Nov 14, 2009 at 6:53 PM, Terry Reedy wrote:
> Chris Rebert wrote:
>> On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO wrote:
>>> Hi, I have some problem with object reference
>>> Say I have this code
>>>
>>> a = b = c = None
>>> slist = [a,b,c]
>>
>> Values are stored in the list, not reference
Chris Rebert wrote:
On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO wrote:
Hi, I have some problem with object reference
Say I have this code
a = b = c = None
slist = [a,b,c]
Values are stored in the list, not references to names.
That is not right either, or else newbies would not be surprised
Chris Rebert writes:
> On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO wrote:
> > Hi, I have some problem with object reference
> > Say I have this code
> >
> > a = b = c = None
> > slist = [a,b,c]
>
> Values are stored in the list, not references to names. Modifying the
> list does not change what v
On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO wrote:
> Hi, I have some problem with object reference
> Say I have this code
>
> a = b = c = None
> slist = [a,b,c]
Values are stored in the list, not references to names. Modifying the
list does not change what values the names a, b, and c have. There
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
--