On Fri, 22 Aug 2008 07:23:18 -0700, Lie wrote:
[...]
>> iterators are once-only objects. there's nothing left in "c" when you
>> enter the inner loop the second time, so nothing is printed.
>>
>>
> Ah, now I see. You have to "restart" the iterator if you want to use it
> the second time (is it po
On Aug 15, 9:55 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Lie wrote:
> > When you've got a nested loop a StopIteration in the Inner Loop would
> > break the loop for the outer loop too:
>
> > a, b, c = [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5]
>
> > def looper(a, b, c):
> > for a_ in a:
> >
Lie wrote:
When you've got a nested loop a StopIteration in the Inner Loop would
break the loop for the outer loop too:
a, b, c = [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5]
def looper(a, b, c):
for a_ in a:
for b_ in b:
for c_ in c:
print a_, b_, c_
loope
When you've got a nested loop a StopIteration in the Inner Loop would
break the loop for the outer loop too:
a, b, c = [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5]
def looper(a, b, c):
for a_ in a:
for b_ in b:
for c_ in c:
print a_, b_, c_
looper(a, b, c) #