Check whether a triangle is equilateral or not

In this pytho if else program, we will program to check whether a triangle is equilateral or not. An equilateral triangle is a triangle with all three sides of equal length

Steps to solve the program
  1. Take 3 sides of the triangle as input through the user.
  2. If all three sides of the triangle are equal then the triangle is an equilateral triangle.
  3. Use an if-else statement to check this.
  4. Print the output.
				
					s1 = int(input("Enter length of side 1: "))
s2 = int(input("Enter length of side 2: "))
s3 = int(input("Enter length of side 3: "))

if s1 == s2 == s3:
    print("It is an equilateral triangle")
else:
    print("It is not an equilateral triangle")
				
			

Output :

				
					Enter length of side 1: 15
Enter length of side 2: 15
Enter length of side 3: 15
It is an equilateral triangle
				
			

Related Articles

convert the month name to the number of days.

check whether a triangle is scalene or not.

Leave a Comment