
Answer-first summary for fast verification
Answer: `sys.path`
The correct answer is **sys.path**. ### Why it is Correct The `sys.path` list in Python contains the strings that specify the search path for modules. When a module is imported, the interpreter searches these directories in the order they appear in the list. This variable is initialized from the `PYTHONPATH` environment variable and installation-dependent defaults, and it can be modified dynamically during execution. ### Why other options are incorrect * **os.path**: This module provides helpful utilities for manipulating filesystem paths (like joining or splitting paths), but it does not control the Python interpreter's module resolution logic. * **importlib.resource_path**: Functions within the `importlib` suite are used to locate and access resources (data files) within installed packages, not to define the search paths for the packages themselves. * **pypi.path**: This is not a standard Python variable or module. PyPI (Python Package Index) is the external repository for third-party libraries.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.