Generatori · esercizio 1 di 1 · anteprima gratuita
The game so far · chapter 10
In questo momento: Pip va ancora mosso a mano.
Missione di questo capitolo: Manda Pip in una pattuglia generatore. Svolgi gli esercizi, poi il tuo codice la porta in vita.
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()).