euler/python/e009.py

11 lines
257 B
Python
Raw Normal View History

2019-07-14 22:51:31 +02:00
def euler_009():
for a in range(1, 251):
for b in range(a + 1, 501):
c = 1000 - a - b
if a * a + b * b == c * c:
return a * b * c
assert(euler_009() == 31875000)
print("e009.py: {}".format(euler_009()))