Moved problems till 56 to Python.
This commit is contained in:
13
python/e056.py
Normal file
13
python/e056.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user