Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Define a function hypotenuse (a, b) which returns the length of the hypotenuse c

ID: 3775913 • Letter: D

Question

Define a function hypotenuse (a, b) which returns the length of the hypotenuse c, if the other two sides have lengths a and b. Recall that the perimeter of a triangle is the sum of the sides. So in the diagram above, the perimeter has length a + b + c. Your program should assume that a correct version of hypotenuse has already been defined (you don't need to copy it from the first box to the second). Using hypotenuse(a, b), define a function right Triangle Perimeter (a, b) which returns the length of the perimeter in a right triangle whose non-hypotenuse sides have lengths a and b.

Explanation / Answer

def rightTrianglePrimeter(a,b):

//formula to find perimeer of right angled triangle

p=a+b+ sqrt((a*a)+(b*b))

return p

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote