List mapping?

Robert Cragie rcc at nospamthanks_jennic.com
Thu Apr 13 13:25:28 EDT 2000


> Howcome you use reduce at all?
>
> Works fine with just doing
>
> tuplist = map(lambda x: (mylist[x], mylist[x+1]), range(0, len(mylist),
2))

Yep, that's neater. My excuse is that I've only been learning Python for a
couple of weeks...

Robert Cragie





More information about the Python-list mailing list