Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Special Pythagorean triplet

# PROJECT EULER #9


for a in range(1, 500):
    for b in range(1, 500):
        for c in range(1, 500):
            if a ** 2 + b ** 2 == c ** 2 and a + b + c == 1000:
                print(a)
                print(b)
                print(c)
                d = a * b * c
                print(f"Product of {a}, {b} and {c} is: {d}")
 
PREVIOUS NEXT
Tagged: #Special #Pythagorean #triplet
ADD COMMENT
Topic
Name
9+9 =