import my_module abundantnumbers = my_module.generate_abundant_number(28123) abundantsums = [] total = 0 for i in abundantnumbers: for j in abundantnumbers: abundantsums.append(i + j) for i in xrange(1, 28123): if i not in abundantsums: total += i print(total)
def test_generate_abundant_number(self): self.assertEqual(my_module.generate_abundant_number(30), [12, 18, 20, 24, 30])