Leggett & Platt interview question

Please describe how a generator function works