August 2018
Intermediate to advanced
248 pages
5h 51m
English
Whenever you have a collection of things, and you have to go through the collection by taking those things one by one, it is an example of iterator pattern.
So, there are many examples in life, for instance as follows:
What about software?
As we said, iteration is already in Python as a feature. We have iterable objects and iterators. Container or sequence types (list, tuple, string, dictionary, set, and so on) are iterable, meaning we can iterate through them. Iteration is done automatically for you whenever you use the for or while loop to traverse ...