feat(solution): problem #9

main
steven 2023-07-31 14:17:27 -04:00
parent 4570c7b66f
commit 237c116253
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
def is_pythagorean_triplet(a, b, c):
if (a * a + b * b) == (c * c):
return True
else:
return False
tripletFound = False
for i in range(1,500):
for j in range(1,500):
for k in range(1,500):
if is_pythagorean_triplet(i, j, k):
print("triplet:",i,j,k)
if i+j+k == 1000:
print("The product of abc is: " + str(i*j*k))
tripletFound = True
if tripletFound:
break
if tripletFound:
break
if tripletFound:
break