<AptiCode/>

Question 475: What happens when a generator function encounters theyieldkeyword?

tcs
wipro
infosys
general
aptitude
generators

When a generator function encounters theyieldkeyword, it returns the specified value and saves its state. The next time the generator is called, it resumes execution from where it left off.