WAP to check if the given number is
-
perfect number or not.
Answers
Answered by
1
n = int(input("Enter a number: "))
sum = 0
for i in range(1, n):
if(n % i == 0):
sum += i
if (sum == n):
print("Perfect number!")
else:
print("Not a perfect number!")
Similar questions
Math,
2 months ago
Math,
2 months ago
Hindi,
5 months ago
Computer Science,
10 months ago
Math,
10 months ago