Westonci.ca is the premier destination for reliable answers to your questions, brought to you by a community of experts. Discover the answers you need from a community of experts ready to help you with their knowledge and experience in various fields. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

Write a program that accepts the lengths of three sides of a triangle as inputs. the program output should indicate whether or not the triangle is a right triangle. recall from the pythagorean theorem that in a right triangle, the square of one side equals the sum of the squares of the other two sides. use the triangle is a right triangle. and the triangle is not a right triangle. as your final outputs.

Sagot :

The code will have to obey the Pythagorean theorem that says square of the hypotenuse side is equals to the sum of the squares of the other legs.

How to write a code that check if a triangle is a right angle by using Pythagoras theorem?

The code is written in python.

def right_triangle(x, y, z):

    if x**2 + y**2 == z**2 or y**2 + z**2 == x**2 or z**2 + x**2 == y**2:

         print("it is a right angle triangle")

    else:

         print("it is not a right angle triangle")

right_triangle(6, 10, 8)

Code explanation

  • we defined as function named "right_triangle". x, y and z are argument which are the length of the triangle.
  • Then we check if the sides obeys Pythagoras theorem.
  • If it does we print a positive statement else we print a negative statement.

Learn more about python at: https://brainly.com/question/21437082

#SPJ4

View image vintechnology