Python Variables
💡
Exercise 9

Pythagorean 15 XP Easy

Ctrl+Enter Run Ctrl+S Save

The Pythagorean theorem is one of the most famous formulas in math:

$a^2 + b^2 = c^2$

Where a and b are the two shorter sides of a right triangle, and c is the longest side (hypotenuse).

To find c, we can take the square root. In Python, the square root is the same as raising to the power of 0.5:

c = (a ** 2 + b ** 2) ** 0.5
📋 Instructions
Create two variables: - `a` = `3` - `b` = `4` Calculate `c` using the Pythagorean theorem and print it: ``` 5.0 ```
Use c = (a ** 2 + b ** 2) ** 0.5 and then print(c). You've got this — take it step by step!
⚠️ Try solving it yourself first — you'll learn more!
c = (a ** 2 + b ** 2) ** 0.5
🧪 Test Cases
Input
Run your code
Expected
5.0
Expected program output
main.py
Hi! I'm Rex 👋
Output
Ready. Press ▶ Run or Ctrl+Enter.