Python program to find perfect number