Solving Project Euler with Python 2.7