Question: Task 14 Write a Python program that takes a number as input from the user and tells if it is a perfect number or not.

 Task 14 Write a Python program that takes a number as

Task 14 Write a Python program that takes a number as input from the user and tells if it is a perfect number or not. Perfect Number: An integer number is said to be a perfect number if its factors, including 1 but not the number itself, sum to the number. = Sample Input 1: 6 Sample Output 2: 6 is a perfect number Explanation: 6 has 4 divisors: 1,2,3, and 6 . If we add all factors except 6 itself, 1+2+3= 6 . The sum of the factors excluding the number itself sum up to the number therefore " 6 is a perfect number" is printed. = Sample Input 2: 28 Sample Output 2: 28 is a perfect number Explanation: 28 has the divisors: 1, 2, 4, 7, 14, and 28. If we add all factors except itself, we get 28,1+ 2+4+7+14=28

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!