Maintaining explicit state in the generator function

Now we'll look at how our generator functions, which resume execution each time the next value is requested, can maintain state in local variables. In the process of doing so, our generators will be both more interesting and more useful. We'll be showing two generators which demonstrate lazy evaluation, and later we'll combine them into a generator pipeline.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset