Screwing Up looping in Generator

Chris Angelico rosuav at
Tue Jan 3 18:34:59 EST 2017

On Wed, Jan 4, 2017 at 10:05 AM, Deborah Swanson
<python at> wrote:
> Ok, I learned how to use generators in Python 2.7.8, which may be
> different from Python 3 for generators. But I learned from MIT's online
> introduction to python course, and they certainly seem to know python
> well. So what is the correct way to call the generator's next yield in
> Python 3? We only learned to use the next function. If you don't use the
> next function, what do you use?

The built-in next function, not the next method.

# don't do this

# do this


More information about the Python-list mailing list