Iterators are objects that can be iterated upon. In this tutorial, you will learn how iterator works and how you can build your own iterator using __iter__ and __next__ methods.
my_list = ['a','b','c','d']
my_list = iter(my_list)
print next(my_list) > "a"
print next(my_list) > "b"
print next(my_list) > "c"
Building an iterator from scratch is easy in Python. We just have to implement the methods __iter__() and __next__()
It is not necessary that the item in an iterator object has to exhaust. There can be infinite iterators (which never ends). We must be careful when handling such iterator.