Python Version of Coffee Code