How do you obtain a value of search path in Python?
Experience Level: Junior
Tags: Python
Answer
The search path can be obtained using the path variable from the sys module.
Example:
import sys
print(sys.path)
Related Python job interview questions
When would you use the print() function in Python?
Python JuniorWhat is the print() function good for in Python?
Python JuniorWhat is a module search path in Python?
Python JuniorWhat is the import statement good for in Python?
Python Junior