# Prints the sum of divisors of the integers 1 - 10. # Initial version with naive algorithm. import math # for sqrt import time # returns the sum of the proper divisors of n def sum_divisors(n): return sum((k for k in range(1, n) if n % k == 0)) def main(): for i in range(1, 11): print("sum of divisors of", i, "=", sum_divisors(i)) main()