Z
zefciu
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:
And I don't understand it. I thought, that b will be a reference to a,
so changing b should change a as well. 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?
Greets to all PyFans
zefciu
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:
[5, 6]a=[[1,2],[3,4]]
b=a[1]
b=[5,6]
a [[1, 2], [3, 4]]
b
And I don't understand it. I thought, that b will be a reference to a,
so changing b should change a as well. 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?
Greets to all PyFans
zefciu