for x,y in word1, word2 ?

Paul Rubin http
Tue Aug 12 10:16:14 CEST 2008

ssecorp <circularfunc at> writes:
> for x in y and for a in b:

  for x,a in zip(y,b): ...

or the iterator version:

  from itertools import izip
  for x,a in izip(y,b): ...

avoids allocating a list to iterate through.

More information about the Python-list mailing list