In this past lesson, you learned how to use the square root, or

`math.sqrt`

to
compute the hypotenuse of a right triangle using the Pythagorean Theorem, which is $c^2=a^2+b^2$.
In this lesson, we'll use the `if`

statement and develop this more into a complete Pythagorean Theorem
calculator.

This code will ask you for then length of all 3 sides of a right triangle. For the side you don't know,
type in a question mark (?). A series of `if`

statements can be used to figure out which side
to calculate for you.

`if`

statement with a true/false question to see if the variable computed within
its body is the one for which the user typed a ?.
Type your code here:

See your results here:

This code will not run as-is. You have to fix each

`if`

statement to see if the variable computed
within the body of the `if`

statement is the one that has the ? symbol in it.
Dismiss.
Does your code work? Want to run it on your iPhone?

Here's your code:

- Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.
- Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into
this page
- Then click the "Use on iPhone" button that you'll see.