concept iterator in category python

This is an excerpt from Manning's book Python Workout: 50 ten-minute exercises.
Table 1.1 What you need to know (view table figure)
Module for generating random numbers and selecting random elements
for index, item in enumerate('abc'): print(f'{index}: {item}')Returns an iterator with the reversed elements of an iterable

This is an excerpt from Manning's book Mastering Large Datasets with Python: Parallelize and Distribute Your Python Code.
Iterators are the base class of all the Python data types that can be iterated over. That is, we can loop over the items of an iterator, or we can map a function across one, like we learned how to do in chapter 2. The iteration process is defined by a special method called .__iter__(). If a class has this method and returns an object with a .__next__() method, then we can iterate over it.
So far, we’ve talked about the benefits of laziness and about a couple functions that can take advantage of them. In this section, we’ll dig into the details of iterators—objects that we can move through in sequence—and talk about generators—special functions for creating sequences. We touched on generators briefly in chapter 2, but this time we’ll dive even deeper, including a look at small generator expressions.
It’s important that we understand how iterators work because they are fundamental to our ability to process big data on our laptop or desktop computer. We use iterators to replace data with instructions about where to find data and to replace transformations with instructions for how to execute those transformations. This substitution means that the computer only has to concern itself with the data it is processing right now, as opposed to the data it just processed or has to process in the future.

This is an excerpt from Manning's book Hello! Python.
Iterators are a common solution to a frequent programming task: you have a bunch of things—now how do you do something to each one of them? The trick is that most Python collections, be they lists, files, or sets, can be used as iterators.
The interface of an iterator is straightforward. It has a .next() method, which you call over and over again to get each value in the sequence. Once all the values are gone, the iterator raises a StopIteration exception, which tells Python to stop looping. In practice, using an iterator looks something like figure 7.2.
When you ask Python to iterate over an object such as a list, the first thing it does is call iter(object), which calls that object’s __iter__ method and expects to get an iterator object. You don’t need to use the __iter__ call directly unless you’re creating your own custom iterator. In that case, you’ll need to implement both the __iter__ and the next() methods yourself. This listing shows how to use the iter function to create an iterator from any iterable Python object.