Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

perfect number program in python

n = int(input("Enter any number: "))sum1 = 0for i in range(1, n):if(n % i == 0):sum1 = sum1 + iif (sum1 == n):print("The number is a Perfect number!")else:print("The number is not a Perfect number!")
Source by codingcompiler.com #
 
PREVIOUS NEXT
Tagged: #perfect #number #program #python
ADD COMMENT
Topic
Name
5+2 =