Which function re-executes an already-imported module?
A repeated import statement just returns the cached module.
Modules and Packages · Exercise 1 of 4
Fifteen multiple-choice questions on Python modules and packages: import forms, sys.path and sys.modules, the __main__ guard, __init__.py, relative imports, __all__, pip and virtual environments. Pick an option to check your answer instantly.
Which function re-executes an already-imported module?
A repeated import statement just returns the cached module.
What is the main purpose of a virtual environment (python -m venv)?
Two projects can then depend on different versions of the same package.
Which error does from math import squareroot raise?
ModuleNotFoundError (a subclass of ImportError) is raised only when the module itself cannot be found.
After import statistics as st, which call works?
Only the alias st is bound; the name statistics is not.
What does pip install -r requirements.txt do?
pip freeze > requirements.txt records the versions; -r installs them elsewhere.
Timed online tests with instant scores and explanations.