Iterators

Learn about the iterator object, pattern, and its implementation in Python.

We'll cover the following

In typical design pattern parlance, an iterator is an object with a next() method and a done() method; the latter returns True if there are no items left in the sequence. In a programming language without built-in support for iterators, the iterator would be used like this:

Get hands-on with 1200+ tech skills courses.