Computer Science, asked by tsohan, 5 months ago

WAP to check if the given number is
-
perfect number or not.​

Answers

Answered by valeriy69
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!")

\small\mathsf\color{lightgreen}useful?\: \color{white}\mapsto\: \color{orange}brainliest

Similar questions