Solving Project Euler problems in Python