[Tutor] Static Variable in Functions
enalicho at gmail.com
Mon Mar 14 10:22:26 CET 2011
On Mon, Mar 14, 2011 at 8:56 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> "Yasar Arabaci" <yasar11732 at gmail.com> wrote
>> Apperantly, I can change something (which is mutable) inside a list
>> without even touching the list itself :)
> But the point is that you *are* touching the list.
> In this case you have two names referring to the same list.
> You can modify that list (because it is mutable) via either name, it
> makes no difference because they both refer to the same list.
> So a.append() is exactly the same operation as b.append()
Actually, in this case it's not - a.append() is the same as b.append() ;)
More information about the Tutor