Untitled

Anonymous
Plain Text
04/21/2023 10:50 AM
515 B
25
Indexable
Never
import math, sys

c = 0
triplet = []
total = 1

for i in range(1,1000):
    for j in range(1,1000):
        c = i**2 + j**2
        c = math.sqrt(c)
        if c % 1 == 0:
            triplet.append(i)
            triplet.append(j)
            triplet.append(int(c))

            if i + j + c == 1000:
                print(triplet)
                for n in range(3):
                    total *= triplet[n]

                print(total)
                sys.exit()

            triplet = []
Editor is loading...