Python code for Project Euler problems