Python code for project euler.