Difficulty Level: 🟢 Beginner
Domain: Programming Languages (Any Language)
Description:
A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. A divisor of an integer x
is any integer that can divide x
evenly.
Input Example:
num = 28
Output Example:
True
Instructions:
- Implement a function that checks if a given integer
n
is a perfect number. - A perfect number is equal to the sum of all its divisors excluding itself.
- Return
True
if the number is perfect, otherwise returnFalse
.