Leggett & Platt Interview Question

Please describe how a generator function works