Packing list elements into tuples

Scott David Daniels Scott.Daniels at Acm.Org
Tue Nov 9 18:15:40 EST 2004


I kind of like:
     [dict(first=lst[k], second=lst[k+1], third=lst[k+2])
        for k in range(0, len(lst), 3)]

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list