"Laurent Rahuel" wrote:

> Hi,
>
> newList = zip(aList[::2], aList[1::2])
> newList
> [('a', 1), ('b', 2), ('c', 3)]
>
> Regards,
>
> Laurent

Or if aList can get very large and/or the conversion has to be
performed many times:

from itertools import islice
newList = zip(islice(aList,0,None,2), islice(aList,1,None,2))

George

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to