KnowledgeBoat Logo

Computer Science

Write a program to input 3 sides of a triangle and print whether it is an equilateral, scalene or isosceles triangle.

Python

Python Control Flow

74 Likes

Answer

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

Answered By

37 Likes


Related Questions