Infosys Interview Question

What is the generator function, and how is it used?