[Tutor] is it possible to traverse two lists simulatenously using python

Kent Johnson kent37 at tds.net
Thu Apr 30 12:20:40 CEST 2009


On Thu, Apr 30, 2009 at 2:31 AM,  <mobiledreamers at gmail.com> wrote:
> Python
> for i,j in topgirls, richgirls:
>     print i,j

Use zip() or itertools.izip():

for i, j in zip(topgirls, richgirls):
  print i, j

Kent


More information about the Tutor mailing list