Question

Write a program which, given the length of three sides of a triangle, will determine whether...

Write a program which, given the length of three sides of a triangle, will determine whether

the triangle is right- angled. Assume that the third argument to the function is always the

longest side. It will return True if the triangle is right-angled, or False otherwise.

python

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note:- I have added the screenshot of the program to checking tab implementation properly

PYTHON PROGRAM :-

print('Enter three length of three sides of triangle :')

a = [0, 0, 0]

a[0]=int(input('length 1 :\n'))
a[1]=int(input('length 2 :\n'))
a[2]=int(input('length 3 :\n'))

a.sort()

if (((a[0]*a[0])+(a[1]*a[1]))==(a[2]*a[2])):
print("The Triangle is right angled tringle")
else:
print("The Triangle is not right angled tringle")

Program Screenshot :-

Output :-

Add a comment
Know the answer?
Add Answer to:
Write a program which, given the length of three sides of a triangle, will determine whether...
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 a right triangle, the square of the length of one side is equal to the...

    In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sides. Write a program that prompts the user to enter the lengths of three sides of a triangle and then outputs a message indicating whether the triangle is a right triangle. If the triangle is a right triangle, output It is a right-angled triangle If the triangle is not a right triangle, output...

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

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

  • A triangle is expressed by tuples of three positive numbers, which are the length of sides...

    A triangle is expressed by tuples of three positive numbers, which are the length of sides of the triangle. Two triangles a1 and a2 are similar if a2 can be generated by rotating and reflecting triangle a1. For example, t1 = (7, 10, 13) is similar to t2 = (7, 13, 10) since a2 can be obtained by rotating and reflecting t1. (7, 10, 13) rotate −−−→ (10, 13, 7) reflect −−−−→ (7, 13, 10) On the other hand, t1...

  • Problem a (PA4a.java) Write a program to evaluate the area of a triangle given the lengths...

    Problem a (PA4a.java) Write a program to evaluate the area of a triangle given the lengths of its sides using Heron's Formula. Here is an outline: Get the three side lengths from the user (which might have decimal values): a, b, c. Check to ensure that the sides are valid for a triangle. Importantly, the sum of the lengths of any two sides must be larger than the length of the third side (you must check all three sides this...

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

  • 2. Write a program that prompts a user to enter the lengths of sides and angles...

    2. Write a program that prompts a user to enter the lengths of sides and angles for the two triangles described below. The program should calculate the length of the side of the triangle indicated below. Print the two answers to 3 decimal places onto the console screen Triangle 1 Read in the value of the angle, alpha, and the length, a, of the side indicated in the picture below. Calculate the length of the hypotenuse, c, of this right...

  • 10. Write a Python program to check if a triangle is equilateral, isosceles or scalene. An...

    10. Write a Python program to check if a triangle is equilateral, isosceles or scalene. An equilateral triangle is a triangle in which all three sides are equal. A scalene triangle is a triangle that has three unequal sides An isosceles triangle is a triangle with (at least) two equal sides

  • In Python 3 Write code to define a function that uses three arguments, and returns a...

    In Python 3 Write code to define a function that uses three arguments, and returns a result. The function returns True if the first argument is more than or equal to the second argument and less than or equal to the third argument, otherwise it returns False.

  • The "for more practice part" using matlab If the lengths of two sides of a triangle...

    The "for more practice part" using matlab If the lengths of two sides of a triangle and the angle between them are known, the length of the third side can be calculated. Given the lengths of two sides (b and c) of a triangle, and the angle between them alpha in degrees, the third side a is calculated as follows a^2 = b^2 + c^2 - 2b c cos(alpha) White a script thirdside that will prompt the user and read...

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