Iterator is an object that is used to iterate over a collection of objects.
Generator is a function that returns an iterator. Basically, instead of populating and returning a collection of objects at runtime, it generates and yields only one value per call
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать