Answer to PythonChallenge.com