What is the purpose of the 'sys.path' variable in Python?
Correct answer
C. To specify the search path for Python modules
12 views
C. To specify the search path for Python modules
12 views
The 'sys.path' variable in Python is a list of strings that specifies the search path for Python modules. When you import a module in Python, the interpreter searches for the module in each directory specified in 'sys.path', in the order they appear in the list.
Not sure why the answer is C? Ask here and get an explanation.