Python Code - Project Euler and personal code