for v in l:

Nanjundi nanjundi at
Tue Jan 16 02:09:12 CET 2007

l = [i+x for i in l]
l = map(lambda i: i+x, l)


Gert Cuykens wrote:
> is there a other way then this to loop trough a list and change the values
>         i=-1
>         for v in l:
>                 i=i+1
>                 l[i]=v+x
> something like
>         for v in l:
>                 l[v]=l[v]+x

More information about the Python-list mailing list