Python Import Statement
Multiple Choice Easy
Question
After `import math`, how do you call the sqrt function?
Hint
The module name becomes a namespace.
Explanation
After import math, you access functions with the module name as a prefix: math.sqrt(4). This namespace prevents name collisions. To call sqrt(4) directly, use from math import sqrt.
Related Resources
Related Lessons
- Modules
Importing modules.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.