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


You can understand by Watching video :-



Answer :-

side1 = int(input("Enter 1st side of triangle = "))
side2 = int(input("Enter 2nd side of triangle = "))
side3 = int(input("Enter 3rd side of triangle = "))
if side1 == side2 == side3 :
    print("It is a equilateral triangle ")
elif side1 == side2 != side3 or side1 != side2 == side3 or side1 == side3 != side2 :
    print("It is a isosceles triangle ")
elif side1 != side2 != side3 :
    print("It is a scalene triangle ")

Output :-

Enter 1st side of triangle = 7
Enter 2nd side of triangle = 7
Enter  3rd side of triangle = 7
It is a equilateral triangle

>>>

Enter 1st side of triangle = 6
Enter 2nd side of triangle = 4
Enter  3rd side of triangle = 4
It is a isosceles triangle

>>> 

Enter 1st side of triangle = 4
Enter 2nd side of triangle = 8
Enter  3rd side of triangle = 2
It is a scalene triangle

>>>

3 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Thank you so much for this website, I found this very helpful, it really helps me a lot, I can even learn through this instead of just copying

    ReplyDelete
  2. paavan is the person who commented with identity giri free,so i am not responsible for it.

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post