Generators · exercise 1 of 1 · free preview
The game so far · chapter 10
Right now: Pip still has to be walked by hand.
This chapter's mission: Sends Pip on a generator patrol. Work through the exercises, then your own code brings it to life.
A generator function uses yield instead of return. Each yield hands out one value, then pauses until the next ask.
Write count() that yields 1, then 2, then 3. Print list(count()).