+ 3
What is generator in python?
I don't understand generator and what is generator in other languages like Java and c++?
4 Réponses
+ 12
Python generator : Generators functions allow you to declare a function that behaves like an iterator, i.e. it can be used in a for loop.
+ 2
I read this definition but it's not clear for me. Are there any other explanation?
+ 2
generator basically allows you to return a function's output infinite times using for and yield instead of return word where you just exit the function by destroying all the temporary values created in between