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):
frobnicate(a[i], a[i+1])
?
I think I once saw something like
for (x, y) in forgotten_expression_using(a):
frobnicate(x, y)
Or maybe I just dreamt it! :)
Thanks!
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list
- iterating "by twos" kj
- Re: iterating "by twos" George Trojan
- Re: iterating "by twos" bearophileHUGS
- Re: iterating "by twos" giltay
- Re: iterating "by twos" giltay
- Re: iterating "by twos" Erik Max Francis
- Re: iterating "by twos" Erik Max Francis
- Re: iterating "by twos" giltay
- Re: iterating "by twos" william tanksley
- Re: iterating "by twos" kj
- Re: iterating "by twos" Terry Reedy
