Alan Isaac <aisaac at american.edu> writes: > (Of course the print statement is just illustrative.) > What is the fastest way? (Ignore the import time.) You have to try a bunch of different ways and time them. One idea (untested): def pairs(seq): while True: yield (seq.next(), seq.next())