iterating "by twos"
socyl at 987jk.com.invalid
Tue Jul 29 19:36:11 CEST 2008
Is there a special pythonic idiom for iterating over a list (or
tuple) two elements at a time?
I mean, other than
for i in range(0, len(a), 2):
I think I once saw something like
for (x, y) in forgotten_expression_using(a):
Or maybe I just dreamt it! :)
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
More information about the Python-list