This script runs the Pythagorean Converse to determine if a triangle is acute, obtuse, or right. If you use values that do not make a triangle, then it will also let you know the numbers cannot be a triangle.
#We want to determine if a triangle is right, acute, or obtuse #Define a function for the sides of a triangle def converse(a,b,c): sides = [a,b,c] #sort the three inputs sortedSides = sorted(sides) #is it a triangle if sortedSides[0]+sortedSides[1] <= sortedSides[2]: print("This is not a triangle.") #is it acute, obtuse, or right elif sortedSides[0]**2 + sortedSides[1]**2 > sortedSides[2]**2: print("This triangle is acute.") elif sortedSides[0]**2 + sortedSides[1]**2 < sortedSides[2]**2: print("This triangle is obtuse.") else: print("This triangle is right.")