Can someone explain the mechanics of why it prints only 3 lines, instead of 24. I know its due to the fact that the generator function is exhausted, but how?
def counter_gen(size):
cur=1
while cur <= size:
yield cur
cur +=1
c1=counter_gen(8)
c2=counter_gen(3)
for x in c1:
for y in c2:
print x,y