Interactive games in Python, sample code