mirror of
https://github.com/correl/euler.git
synced 2024-11-27 19:19:50 +00:00
10 lines
297 B
Python
10 lines
297 B
Python
|
TRIPLET_SUM = 1000
|
||
|
|
||
|
for c in range(TRIPLET_SUM - 3, 3, -2):
|
||
|
diff = TRIPLET_SUM - c
|
||
|
for x in range(1, int(diff / 2) + 1):
|
||
|
(a, b) = (x, diff - x)
|
||
|
if a**2 + b**2 == c**2:
|
||
|
print '{a}**2 + {b}**2 == {c}**2'.format(a=a, b=b, c=c)
|
||
|
print 'Product: ', a*b*c
|