map, index

Duncan Booth duncan.booth at invalid.invalid
Sun Mar 28 09:53:36 EDT 2010


Luis Quesada <l.quesada at 4c.ucc.ie> wrote:

> Is there a way 
> of writing the following without using zip:
>      map(lambda (id,v):id*v,zip(range(len(L)),L))

[ id*v for id,v in enumerate(L) ]



More information about the Python-list mailing list