https://projecteuler.net/problem=9
A Pythagorean triplet is a set of three natural numbers, $a < b < c$, for which,
$$a^2 + b^2 = c^2$$For example, $3^2 + 4^2 = 9 + 16 = 25 = 5^2$.
There exists exactly one Pythagorean triplet for which $a + b + c = 1000$. Find the product abc.
In [21]:
a=list(range(500)) # I know that no value can be over 500, so range 500 is a safe bet.
b=list(range(500))
c=list(range(500))
d=[]
e=[]
f=[]
for x in a:
for y in b:
for z in c:
if x+y+z==1000 and ((x**2)+(y**2)==(z**2)) and x>0 and y>0 and z>0: # my conditions
d.append(x)
e.append(y)
f.append(z)
print(d)
print(e)
print(f)
# our Pythagorean triplet is 200,375, and 425!
In [ ]: