iterator - enumerate()-ing a generator in Python -


I want to know what happens when I pass the result of the generator function to calculate the dragon (). Example:

  def too BigHello (): i = 0 while i  

whether the math becomes dull, or Does this mistake all in the first? I am 99.999% sure that it is lazy, can I treat it like a generator festival or do I need to see anything?

It is lazy to prove that this is a matter of fact:

  & gt; & Gt; & Gt; Def abc (): ... letters = ['a', 'b', 'c'] ... for the letter in the letter: ... print letter ... yield sheet ... & gt; & Gt; & Gt; Numbered = count (ABC ())> gt; & Gt; & Gt; For me, the numbered word: ... print i, word ... a 0 a b 1 b c 2 c  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -