Computer Science, asked by khushikumari711089, 2 months ago

Write a program to accept an integer, compute and check whether it is a perfect number or not. A number is
known as perfect number, if the sum of factors (excluding the number) is equal to the number, eg. 6=1+2+3.​

Answers

Answered by srohanmys
0

Answer:

It is not

Explanation:

Because it contains -and+

Answered by nehagupta69
3

Explanation:

n = int(input("Enter any number: ")) sum1 = 0 for i in range(1, n): if(n % i == 0): sum1 = sum1 + i if (sum1 == n): print("The number is a Perfect number! ") else: print("The number is not a Perfect number! ") .

Similar questions