Check whether a triangle is isosceles or not.

In this python if else program, we will check whether a triangle is isosceles or not depending on the lengths of the sides.

An isosceles triangle is a triangle with (at least) two equal sides.

Steps to solve the program
  1. Take 3 sides of the triangle as input through the user.
  2. If any two sides of the triangle are equal then the triangle is an isosceles 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 or s2 == s3 or s1 == s3:
    print("It is an isosceles triangle")
else:
    print("It is not an isosceles triangle")
				
			

Output :

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

Related Articles

check whether a triangle is scalene or not.

reads month and returns season for that month.

Leave a Comment