List mapping?

Robert Cragie rcc at nospamthanks_jennic.com
Thu Apr 13 11:36:03 EDT 2000


> Try this:
> mylist = ['/a','1','/b','2','/c','3']
> map(lambda x: reduce(lambda a, b: (a,b), mylist[x:x+2]), range(0,
> len(mylist), 2))

Sorry, forgot to assign...

mylist = ['/a','1','/b','2','/c','3']
tuplist = map(lambda x: reduce(lambda a, b: (a,b), mylist[x:x+2]), range(0,
len(mylist), 2))

Robert Cragie





More information about the Python-list mailing list