Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

perfect numbers python

n=int(input("Enter a Number : "))
c = 0
for i in range(1, n):
    if n % i == 0:
        c = c + i
if c == n:
    print(n, "The number is a Perfect number!")
else:
    print(n, "The number is not a Perfect number!")
Source by codingcompiler.com #
 
PREVIOUS NEXT
Tagged: #perfect #numbers #python
ADD COMMENT
Topic
Name
6+8 =