1 for x in range(1,1001): 2 factor = [] 3 for i in range(1,x): 4 if x%i == 0: 5 factor.append(i) 6 if sum(factor) == x: 7 print(x)
1 for x in range(1,1001): 2 factor = [] 3 for i in range(1,x): 4 if x%i == 0: 5 factor.append(i) 6 if sum(factor) == x: 7 print(x)