Computer Science, asked by arunkumarns2808, 2 months ago

write a python program to find perfect number

Answers

Answered by Anonymous
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 Anonymous
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