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

Enter first side : 10

Enter second side : 5

Enter third side : 10

Isosceles Triangle

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad