Question: A positive integer n is called perfect if it is equal to the sum of its integer divisors, except itself. For example, the divisors of
A positive integer n is called perfect if it is equal to the sum of its integer divisors, except itself. For example, the divisors of integer 6 are 1, 2, 3, and 6, and since 6 = 1 + 2 + 3, then 6 is a perfect integer. So is 28 (verify it). Write a Python function, called it perf(n), that returns 'Yes' if n is a perfect integer, and 'No' otherwise.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
