Question

10. Write a Python program to check if a triangle is equilateral, isosceles or scalene. An equilateral triangle is a triangle
0 0
Add a comment Improve this question Transcribed image text
Answer #1

print("Enter triangle sides: ")
x=int(input("x: "))
y=int(input("y: "))
z=int(input("z: "))

if x==y==z:
   print("Equilateral triangle")
elif x==y or y==z or z==x:
   print("isosceles triangle")
else:
   print("Scalene triangle")

1 print(Enter triangle sides: ) 2 x-int(input(x: )) 3 y=int(input(y:)) A int(input(Z: )) 7 print(Equilateral triangl

Enter triangle sides: x: 6 y: 6 z: 5 isosceles triangle

Add a comment
Answer #2

Write a Python program to check whether the triangle is equilateral, isosceles or scalene triangle.

a = int(input("Enter first side ="))

b = int(input("Enter second side ="))

c = int(input("Enter base side ="))

if a==b==c:

  print("We make equilateral triangle from given side")

elif a==b and a+b>=c and b+a>=c:

  print("We make isosceles triangle from given side")

else :

  print("We make scalene triangle from given side")


answered by: Surendra prajapar
Add a comment
Know the answer?
Add Answer to:
10. Write a Python program to check if a triangle is equilateral, isosceles or scalene. An...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Your math professor asked you to determine whether triangles are equilateral, isosceles, or scalene triangles. You...

    Your math professor asked you to determine whether triangles are equilateral, isosceles, or scalene triangles. You need to write a MATLAB program that accepts the side lengths for sides A, B, and C of a triangle and compares the side lengths in order to determine if the triangle is equilateral, isosceles, or scalene. Each triangle will only be classified as a single type based on the definitions below: 1. An equilateral triangle is a triangle in which all three sides...

  • ***IN PYTHON: Scalene triangle: All sides have different lengths Isosceles triangle: Two sides have the same...

    ***IN PYTHON: Scalene triangle: All sides have different lengths Isosceles triangle: Two sides have the same length Equilateral triangle: All sides are equal Write a program to ask for the length of 3 sides a, b and c. Ask for three sides at a time Determine the type of triangle given three sides Handle all kinds of errors - 1. not integers, int() conversion fails 2. not enough args, 3. too many arguments HINT: use the len() function to check...

  • c++ 17 please help!! A triangle can be of three types-one in which all the sides...

    c++ 17 please help!! A triangle can be of three types-one in which all the sides are equal, or one in which only two sides are equal, or one in which all the three sides are unequal. You are assigned to write a program that allows the user to enter the three sides of a triangle. The program should use three double variables to store the three sides of the triangle. The program should also be able to print the...

  • It is required to read three real numbers that represent the sides of a possible triangle. For th...

    It is required to read three real numbers that represent the sides of a possible triangle. For the sides to form a triangle, the sum of each pair of sides must be greater than the third side. This has to be fulfilled for each pair of sides. The program must determine the values ​​of the following alphanumeric variables (string type): tria: You will be assigned the value "triangle" if the three real numbers form a triangle or the value of...

  • Consider the following program which classifies triangles as one of a scalene, isosceles, right or equilateral...

    Consider the following program which classifies triangles as one of a scalene, isosceles, right or equilateral triangle and computes its area. Suppose it is initially tested using the first 4 test cases provided in the following table. T5 is added to the test case and program incorrectly computes the area. Debugging reveals an error in Statement 11. It uses expression a*2 instead of a*a. Suppose the fault is corrected and new program must be rerun to verify that it produces...

  • In C program #include<stdio.h> Task is to implement the Triangle Program in C. The specification for...

    In C program #include<stdio.h> Task is to implement the Triangle Program in C. The specification for the program is: The triangle program accepts three strings, a, b, and c (the sides of a triangle) as command line parameters. The sides of the triangle must be integers. The sides a, b, and c must satisfy the following conditions: c1. 1 ≤ a ≤ 200 c2. 1 ≤ b ≤ 200 c3. 1 ≤ c ≤ 200 c4. a < b +...

  • Consider again the triangle classification program with a slightly different specification: The program reads floating values...

    Consider again the triangle classification program with a slightly different specification: The program reads floating values from the standard input. The three values A, B, and C are interpreted as representing the lengths of the sides of a triangle. The program then prints a message to the standard output that states whether the triangle, if it can be formed, is scalene, isosceles, equilateral, or right angled. Determine the following for the above program: Part a: For the boundary condition A+B>Ccase...

  • Using python 3.x to solve this problem. Equilateral Triangle Class EqTri Write a class that has...

    Using python 3.x to solve this problem. Equilateral Triangle Class EqTri Write a class that has several functions related to an Equilateral length : float Triangle. The constructor shouldgetArea): float accept a one parameter for the +getPerimeter): float length (which is the same for all 3+float-0 : float sides in an equilateral triangle) + _str) string -str--() method should return a string such as "Rectangle (Area:50)" float) method should return the area (Same functionality as getArea) Math (area- length?, perim/circum...

  • Welcome to the Triangles program Enter length 1: 3 Enter length 2: 5 Enter length 3:...

    Welcome to the Triangles program Enter length 1: 3 Enter length 2: 5 Enter length 3: 5 Enter the base: 5 Enter the height: 8 --------------------- The triangle is Isosceles since it has two equal length sides. Isosceles triangle also has two equal angles The area is: 20 The permimeter is: 13 Continue? (y/n): y Enter length 1: 10 Enter length 2: 10 Enter length 3: 10 Enter the base: 10 Enter the height: 7 --------------------- The triangle is Equilateral...

  • PYTHON (Triangle Inequality) Write a program triangle.py that takes three integers as command-line arguments and writes...

    PYTHON (Triangle Inequality) Write a program triangle.py that takes three integers as command-line arguments and writes True if each one of them is less than or equal to the sum of the other two and False otherwise. Note: this computation tests whether the three numbers could be the lengths of the sides of some triangle.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT