1. Home
  2. Computer Science MCQs
  3. Bootstrap
  4. What is the purpose of the 'sys.path' variable in Python?

Added 10 Feb 2024

What is the purpose of the 'sys.path' variable in Python?

  1. To store the Python interpreter binary path
  2. To define the location of the Python standard library
  3. To specify the search path for Python modules Correct answer
  4. To store system-wide Python configurations

Correct answer

C. To specify the search path for Python modules

12 views

MCQSEXAM

Explanation

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.

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Bootstrap MCQs

Practise all Bootstrap MCQs

Similar MCQs