write a python program to find perfect number
Answers
Answered by
2
Explanation:
Here is source code of the Python Program to check if a number is a Perfect number. The program output is also shown below. 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!
Answered by
3
Answer:
Here is source code of the Python Program to check if a number is a Perfect number. The program output is also shown below. 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!
Similar questions