Re: A little more advanced for loop

2007-02-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Larry Bates <[EMAIL PROTECTED]> wrote: > >Note: if lists are long take a look at itertools izip. zip creates >a list of lists which could take lots of memory/time if they are VERY >large. itertools izip iterates over them in place. That's half-true -- while izip

Re: A little more advanced for loop

2007-02-10 Thread Duncan Booth
Larry Bates <[EMAIL PROTECTED]> wrote: > Note: if lists are long take a look at itertools izip. zip creates > a list of lists which could take lots of memory/time if they are VERY > large. itertools izip iterates over them in place. That's interesting. I was going to quibble with the assertion

Re: A little more advanced for loop

2007-02-09 Thread Larry Bates
Horta wrote: > On Feb 9, 9:00 am, Stephan Diehl <[EMAIL PROTECTED]> wrote: >> Horta wrote: >>> Hi folks, >>> Suppose I have to loop over 3 lists being the same size at the same >>> time and order. How can I do that without using the range() function >>> or whatever indexing? >>> Example using

Re: A little more advanced for loop

2007-02-09 Thread Horta
On Feb 9, 9:00 am, Stephan Diehl <[EMAIL PROTECTED]> wrote: > Horta wrote: > > Hi folks, > > > Suppose I have to loop over 3 lists being the same size at the same > > time and order. How can I do that without using the range() function > > or whatever indexing? > > > Example using range: > >

Re: A little more advanced for loop

2007-02-09 Thread Stephan Diehl
Horta wrote: > Hi folks, > > Suppose I have to loop over 3 lists being the same size at the same > time and order. How can I do that without using the range() function > or whatever indexing? > > Example using range: > > a = ['aaa', ''] > b = ['bb', ''] > c = ['c', ''] > > for

Re: A little more advanced for loop

2007-02-09 Thread Diez B. Roggisch
Horta wrote: > Hi folks, > > Suppose I have to loop over 3 lists being the same size at the same > time and order. How can I do that without using the range() function > or whatever indexing? > > Example using range: > > a = ['aaa', ''] > b = ['bb', ''] > c = ['c', ''] > > fo