Addressing the last element of a list

Paul Rubin http
Mon Nov 14 04:08:48 EST 2005


Antoon Pardon <apardon at forel.vub.ac.be> writes:
> We could then have something like the following.
> 
> a = 5
> b = a
> a @= 7
> b ==> would result in 7.

Ouch!  :-(((

Can't you live with

a = [5]
b = a
a[0] = 7

so b[0] is now 7.



More information about the Python-list mailing list