Python program to check entered number is perfect or not? |EasyCoding45

Python program to check entered number is perfect or not?



In this Tutorial we are going to learn how we can Write a Python program to check whether entered number is perfect or not?


Program :- (Python program to check entered number is perfect or not?)


number=int(input("Enter Number To check whether it is perfect or not ? "))

temp=number

add=0


for i in range(1,number-1,+1):

    if(number%i==0):

        add=add+i

 

if temp==add:

    print(temp,"is a Perfect Number ")

else:

    print(temp,"is Not a Perfect Number ")



Output :-




Comments