Ad

Find Pythagorean triples with Euclid's Formula. The formula is - with a>b, find a squared + b squared, a squared - b squared, and 2 x a x b. Give the result as the the three answers in a list sorted from smallest to biggest

def find_triple(a, b):
    ans1 = a**2 + b**2
    ans2 = a**2 - b**2
    ans3 = 2 * a * b
    triple = [ans1, ans2, ans3]
    triple.sort()
    return triple