Iterating throught 2 lists at the same time

Aahz Maruch aahz at panix.com
Sun Aug 26 11:53:27 EDT 2001


In article <9m3rmg$8u55$1 at ID-91520.news.dfncis.de>,
Rajarshi Guha  <rajarshi at presidency.com> wrote:
>
>I know I could maintain counters and use the index notation - but it seems 
>a little crude for Python :) Are there any, more elegant ways?

zip() is the elegant way, but not if you're using 1.5.2; you'll probably
want to upgrade to Python 2.1.1 if you can.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"Plus ca change, plus c'est la meme chose."



More information about the Python-list mailing list