Iterators
This lesson will discuss built-in iterators in Python, and teach you to build your own custom iterator class.
We'll cover the following...
Iterators
As we saw previously, in Python we use the “for” loop and “while” to iterate over the contents of objects:
Press + to interact
for value in [0, 1, 2, 3, 4, 5]:print(value)
Objects that can be used with a for loop are called iterators. An iterator is, therefore, an object that ...