Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Engineering LibreTexts

5.7: Exercise

( \newcommand{\kernel}{\mathrm{null}\,}\)

Before you go on, you might want to work on the following exercise.

Exercise 5.1

Write a function called hypotenuse that takes two parameters, a and b, that represent the lengths of two sides of a right triangle. It should assign to res the length of the third side of the triangle, given by the formula

c=a2+b2


This page titled 5.7: Exercise is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Allen B. Downey (Green Tea Press) via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?