Databricks Certified Data Engineer Professional — Question 81

Which Python variable contains a list of directories to be searched when trying to locate required modules?

Answer options

Correct answer: B

Explanation

The correct answer is B, sys.path, as it specifically contains the list of directories that Python searches for modules. The other options do not serve this purpose; for instance, importlib.resource_path relates to resource management, os.path deals with file path manipulations, and pypi.path and pylib.source are not standard Python variables for module searching.