```
class Solution(object):
def checkPerfectNumber(self, num):
"""
:type num: int
:rtype: bool
"""
if num <= 1:
return False
total = 0
for i in range(1, int(num**0.5)+1):
if num%i == 0:
total += i
total += num/i
return total - num == num
```

Since the "Perfect Numbers" are quite a few (only 5 under 1e8 ), we can calculated in advance.

```
class Solution(object):
def checkPerfectNumber(self, num):
"""
:type num: int
:rtype: bool
"""
return num == 6 or num == 28 or num == 496 or num == 8128 or num == 33550336
```