ACTIVITY 44 / 50
Try as many times as you needImport a module
Let’s understand
A module is Python code you can import. import math provides mathematical tools. Access a function through the module name and a dot: math.sqrt finds a square root.
Listen to the explanation
Example
import math
print(math.sqrt(16))Import math and print the square root of 81 using math.sqrt.
I need a hint
sqrt returns a float, so the output is 9.0.
How to find an error
- Read the last line of the error message.
- Find the indicated line. Check quotes, parentheses and indentation.
- Change one thing and run again.
main.py
4 spaces
Your draft stays in this browser.
Result
PythonYour program’s output will appear here. Click Run.
Мой профиль