Microsoft interview question

How do you implement a generator in python