Addressing the last element of a list

Steven D'Aprano steve at REMOVETHIScyber.com.au
Thu Nov 10 16:47:34 EST 2005


On Thu, 10 Nov 2005 08:19:36 -0800, bonono at gmail.com wrote:

> This mutable/immutable object and name/variable is confusing.

It is a source of confusion to newbies, because it is a distinction that
may not be intuitively obvious, and it is a programming model that isn't
quite the same as many people are used to.

One way that may help thinking about it is to imagine that Python names
are "like" pointers. That may make people feel less threatened, since
pointers in languages that use them often confuse beginners too.

As for mutable/immutable, that's simple too. Some objects can change their
value, and some objects can't.

But the best way to get an intuitive feel for how Python operates is to
start up an interactive session and just experiment!


-- 
Steven.




More information about the Python-list mailing list