euler/python/e056.py

14 lines
283 B
Python
Raw Normal View History

2019-07-18 03:29:59 +02:00
def get_digit_sum(n):
return sum(map(int, str(n)))
def euler_056():
s = max([get_digit_sum(a**b) for a in range(1, 100)
for b in range(1, 100)])
return s
if __name__ == "__main__":
print("e056.py: " + str(euler_056()))
assert(euler_056() == 972)