Solution for Euler by Python