Мой профиль
ACTIVITY 44 / 50

Import a module

Try as many times as you need

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))
YOUR MISSION

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
  1. Read the last line of the error message.
  2. Find the indicated line. Check quotes, parentheses and indentation.
  3. Change one thing and run again.

main.py

4 spaces

Your draft stays in this browser.

Result

Python
Your program’s output will appear here. Click Run.