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
0
Answer:
It is not
Explanation:
Because it contains -and+
Answered by
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
Math,
1 month ago
World Languages,
1 month ago
Physics,
2 months ago
Science,
2 months ago
English,
8 months ago