Editor

Predict the Output: import vs from...import

Beginner · Predict the output · from Python Imports: How import Really Works (Modules, Packages, Paths)

From the lesson: Python Imports: How import Really Works (Modules, Packages, Paths)

Think of a library. Instead of buying every book in the world and keeping them in your house, you go to the library and check out only the books you need. When you're done, you return them.

Read the lesson

What will this code print?

from math import sqrt, pow

a = sqrt(49)
b = pow(2, 3)
print(a)
print(b)

Remember that math.pow() returns a float.

# Type the exact output

More Imports exercises

All Python exercises · 50 practice problems · Modules & Packaging quiz