Python Program to Check Type of Triangle
Write Python Program to Check Type of Triangle
# Python Program to Check Type of Triangle # get the sides of triangle side1 = int(input("Enter Length of Side 1 :--> ")) side2 = int(input("Enter Length of Side 2 :--> ")) side3 = int(input("Enter Length of Side 3 :--> ")) if side1 == side2 and side2 == side3: print("Given Triangle is Equilateral") elif side1 == side2 or side2 == side3 or side3 == side1 : print("Given Triangle is Isosceles") else : print("Given Triangle is Scalene")
Output:
Run 1:
Enter Length of Side 1 :--> 5
Enter Length of Side 2 :--> 6
Enter Length of Side 3 :--> 7
Given Triangle is Scalene
Run 2:
Enter Length of Side 1 :--> 5
Enter Length of Side 2 :--> 5
Enter Length of Side 3 :--> 2
Given Triangle is Isosceles