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
  • ***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...

  • 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...

  • 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.

  • PLEASE READ AND CODE IN BASIC C++ CODE. ALSO, PLEASE CODE USING THIS DO WHILE LOOP...

    PLEASE READ AND CODE IN BASIC C++ CODE. ALSO, PLEASE CODE USING THIS DO WHILE LOOP AND FORMAT: #include <iostream> using namespace std; int main() { //variables here    do { // program here             }while (true);    } Objectives To learn to code, compile and run a program containing SELECTION structures Assignment Write an interactive C++.program to have a user input the length of three sides of a triangle. Allow the user to enter the sides...

  • An equilateral triangle is a triangle with all three sides of equal length. All of the...

    An equilateral triangle is a triangle with all three sides of equal length. All of the angles in an equilateral triangle are equal. What is the measure of angle θ in the triangle shown?(Figure 1) Recall that the sum of the angles in a triangle equals 180∘. Express your answer in degrees.

  • help im alittle lost my teacher posted all this its suppose to be in C++ language....

    help im alittle lost my teacher posted all this its suppose to be in C++ language. can yoh leave comments ans type the code thank you Write a C++ program that accepts the lengths of three sides (a,b,c) of a triangle as input from the user Validate the user input, so that sides a, b, c can only be POSITIVE. The program output should indicate whether or not the triangle is an Equilateral Triangle, a Right Triangle, Isosceles which is...

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
ADVERTISEMENT