On Jul 29, 1:36 pm, kj <[EMAIL PROTECTED]> wrote:
> Is there a special pythonic idiom for iterating over a list (or
> tuple) two elements at a time?

     I use this one a lot:

for x, y in zip(a, a[1:]):
    frob(x, y)

Geoff G-T

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

Reply via email to