Answer to Question #242519 in Python for prosper2000

Question #242519
Part 1
Section 6.2 of your textbook describes incremental development. Do the exercise at the end of that section:

As an exercise, use incremental development to write a function called hypotenuse that returns the length of the hypotenuse of a right triangle given the lengths of the other two legs as arguments. Record each stage of the development process as you go. (Downey, 2015)

After the final stage of development, print the output of hypotenuse(3, 4) and two other calls to hypotenuse with different arguments.

Include all of the following in your Learning Journal:

An explanation of each stage of development, including code and any test input and output.
The output of hypotenuse(3,4).
The output of two additional calls to hypotenuse with different arguments.
1
Expert's answer
2021-09-26T18:51:10-0400
def hypotenuse(x, y):
    return ((x**2 + y**2)) ** 0.5

print(hypotenuse(int(input("Enter the length of perpendicular: ")), int(input("Enter the length of base: "))))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Raymond Ekwubiri
28.09.21, 13:23

The answer to my questions has been very helpful and straight to the question asked. I am very grateful for your continual help in my Python Programming assignment

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS