A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a2 + b2 = c2
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc.
def py_trip(num):
for a in range(0, num, 1):
for b in range(a+1, num, 1):
for c in range(b+1, num, 1):
if a**2 + b**2 == c**2 and a+b+c == num:
return a, b, c, a*b*c
py_trip(1000)
(200, 375, 425, 31875000)