Python Perfect Number Program Hackerrank Log