+ 1
What is the difference between iterator and generator?
Can you help me
3 Respuestas
+ 2
Generator gives us a sequence of values to iterate upon wheras an iterator returns us an iterator object- one value at a time.
Go here for detailed information 👇
https://data-flair.training/blogs/python-generator-vs-iterator/
+ 2
it is much easier to use generators function to create iterators because they simplify their creation, but a custom Iterator gives you more freedom and you can also implement other methods according to your requirements
0
But a sequence can be converted to iterator by iter than why to use generation