Generatory · ćwiczenie 1 z 1 · bezpłatny podgląd
The game so far · chapter 10
Na razie: Pipa wciąż trzeba prowadzić ręcznie.
Misja tego rozdziału: Wysyła Pipa na patrol generatora. Przejdź przez ćwiczenia, a potem Twój własny kod nada temu życie.
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()).