references ???

Emile van Sebille emile at fenx.com
Thu Nov 1 11:54:46 EST 2001


"Thomas Weidner" <wolf359_ at gmx.net> wrote in message
news:pan.2001.11.01.17.30.27.280.2271 at gmx.net...
> Hi,
>
> I think anybody here knows what references,like in java,c++ or perl, are.
> How can i use references in python ?
>
> 2.Question:
> l=[1,2,3,4,5,6]
> for i in l:i=0
> print l
>
> l is still [1,2,3,4,5,6]. How to make changes made to i also apply to l ?

for i in len(l):
    l[i] = 0

--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list