Example #1
0
def test():
    assert div(12) == [1, 2, 3, 4, 6, 12]
    assert abundant(12)
    abdnts = find_abundant(100)
    # print abdnts
    assert is_sum_of_abundant(24, abdnts)
    assert not abundant(11)
    # assert not is_sum_of_abundant(11, abdnts).all()
    print "Passed tests!!"
Example #2
0
def abundant(n):
    # returns true if n is abundant
    assert type(n) == int
    assert n > 0
    ds = div(n)
    # print "the divisors of {} are {}".format(n, ds)
    sds = sum(ds[:-1])
    if sds > n:
        return True
    else:
        return False