Project Euler Hackerrank Solution For Python