Pregunta de entrevista de Morgan Stanley

What are generator functions in python? How to implement those?