def isPythagoreanTriple(a: float, b: float, c: float) -> bool: """ Return true if all the following are True: - check that numbers are ascending - check that a^2 + b^2 = c^2 - check that a, b, and c are positive """ return ( (a < b and b < c) and ((a**2 + b**2) == c**2) and not (a < 0 or b < 0 or c < 0) ) print("Testing isPythagoreanTriple()...", end="") assert isPythagoreanTriple(3, 4, 5) == True # 3**2 + 4**2 == 5**2 assert isPythagoreanTriple(5, 4, 3) == False # wrong order assert isPythagoreanTriple(4, 5, 3) == False # wrong order assert isPythagoreanTriple(5, 12, 13) == True # 5**2 + 12**2 == 13**2 assert isPythagoreanTriple(13, 12, 5) == False # wrong order assert isPythagoreanTriple(12, 13, 5) == False # wrong order assert isPythagoreanTriple(-3, 4, 5) == False # no negatives assert isPythagoreanTriple(0, 5, 5) == False # no 0's assert isPythagoreanTriple(1, 1, 1) == False # 1**2 + 1**2 != 1**2 assert isPythagoreanTriple(3, 4, 6) == False # 3**2 + 4**2 != 6**2 print("Passed!")