How-to articles, tricks, and solutions about GENERATOR

What does the "yield" keyword do?

Python, the yield keyword is used in the body of a function like a return statement, but instead of returning a value and terminating the function, it yields a value and suspends the function's execution.