programming-examples/python/Math/Find out, if the given number is abundant.py

5 lines
170 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
def is_abundant(n):
fctr_sum = sum([fctr for fctr in range(1, n) if n % fctr == 0])
return fctr_sum > n
print(is_abundant(12))
print(is_abundant(13))