Programming Examples
Python program to input 3 sides of a triangle and print whether it is an equilateral scalene or isosceles triangle
Write a program to input 3 sides of a triangle and print whether it is an equilateral, scalene or isosceles triangle.
Solution
a = int(input("Enter first side : "))
b = int(input("Enter second side : "))
c = int(input("Enter third side : "))
if a == b and b == c :
print("Equilateral Triangle")
elif a == b or b == c or c == a:
print("Isosceles Triangle")
else :
print("Scalene Triangle")
Output/ Explanation:
Enter first side : 10
Enter second side : 5
Enter third side : 10
Isosceles Triangle