Untitled
unknown
plain_text
a year ago
728 B
11
Indexable
while True: # User Input side1 = int(input("Enter the first side of triangle: ")) side2 = int(input("Enter the second side of triangle: ")) side3 = int(input("Enter the third side of triangle: ")) # Stop looping if there's any negative input value if side1 < 0 or side2 < 0 or side3 < 0: break # Condition of not a triangle if side1 + side2 <= side3 or side1 + side3 <= side2 or side2 + side3 <= side1: print("Not a triangle") else: # Classify the triangle if side1 != side2 != side3: print("Scalene triangle") elif side1 == side2 == side3: print("Equilateral triangle") else: print("Isosceles triangle")
Editor is loading...