I am new to python, I want to know the concept of generator and iterator
Please somebody explain what is this and how it works with some nice examples.
I am new to python, I want to know the concept of generator and iterator
Please somebody explain what is this and how it works with some nice examples.
I will direct you to two great answers on SO:
Understanding Generators in Python
and
Difference between Python's Generators and Iterators
Finally, this article is what finally got me to understand it properly: