How to make a Python generator - Python Programming for beginners