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
Test.describe("Basic Tests")
Test.assert_equals(find_triple(7,2),[28,45,53])
Test.assert_equals(find_triple(4,3),[7,24,25])
Test.assert_equals(find_triple(3,2),[5,12,13])