zefciu wrote: > Hello! > > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. I thought I understand > it, but I have just typed in following commands: > >>>> a=[[1,2],[3,4]] >>>> b=a[1] >>>> b=[5,6] >>>> a > [[1, 2], [3, 4]] >>>> b > [5, 6] > > And I don't understand it. I thought, that b will be a reference to a, > so changing b should change a as well.
It would if you had written "b[:]=[5,6]" > What do I do wrong. And a > second question - can I create a reference to element of a list of > floating points and use this reference to change that element? not like that. > > Greets to all PyFans > zefciu -- http://mail.python.org/mailman/listinfo/python-list