Computer Science, asked by sarthakkundu8, 1 month ago

write a program to input 8 numbers into an array and print perfect numbers from it if any​

Answers

Answered by ChinuKP
0

Answer:

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