What does he mean to day from yrange class is both an iterator as well as iterable
Yrange class not clear
Since the class yrange is containing both the methods that is iter and next which an iterator consists in order to implement its functionality , hence it is an iterator .
It is an iterable because we don’t need to pass any object to it, it makes itself an iterable by setting a range for itself which is denoted by n.
As you may have noticed that that an iterator uses iter and next method and also an iterable gives us a range upto which we can iterate.