python code for http://www.pythonchallenge.com/