#!/usr/bin/env python3
"""Solution 1"""
# 1. write a series of statements that computes the sum of a list of integer numbers
a = [4,5,10,12,-3]
mysum = 0
for i in a:
mysum = mysum + i
print("1.: list is:",a,", its sum is:", mysum)
# 2. write a series of statements that create, from a given integer, the list of its divisors
n = 35
divisors = []
for i in range(1,n-1):
if n%i == 0:
divisors = divisors + [i]
print("2. the divisors of ",n," are: ",divisors)
# 3. write a series of statements that evaluates (True or False) if an integer is a perfect number
n = 35
divisors = []
for i in range(1,n-1):
if n%i == 0:
divisors = divisors + [i]
mysum = 0
for i in divisors:
mysum = mysum + i
if mysum == n:
print("3. is ",n,"a perfect number? -> YES")
else:
print("3. is ",n,"a perfect number? -> NO")
# 4. find all perfect numbers < 10000
for n in range(1,10000):
divisors = []
for i in range(1,n-1):
if n%i == 0:
divisors = divisors + [i]
mysum = 0
for i in divisors:
mysum = mysum + i
if mysum == n:
print("3. is ",n,"a perfect number? -> YES")
# else:
# print("3. is ",n,"a perfect number? -> NO")