Define a function hypotenuse a b which returns the length of

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.

Solution

def rightTrianglePrimeter(a,b):

//formula to find perimeer of right angled triangle

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

return p

 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 t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site