class Solution:
"""
@param num: an integer
@return: returns true when it is a perfect number and false when it is not
"""
'''
大致思路:
1.循环,给出所有的正约数列表,然后取出sum,判断是否等于num,如果等于则返回True,否则False
'''
def checkPerfectNumber(self,num):
l = []
for i in range(1,num-1):
if num%i == 0:
l.append(i)
return sum(l) == num