<AptiCode/>

Question 473: How is a generator function different from a regular function?

tcs
wipro
infosys
general
aptitude
generators
python-programming

Generator functions in Python use theyieldkeyword to produce a sequence of values. When a generator function is called, it returns a generator object that can be iterated over to get values one at a time.