What is the difference between import x and from x import y in Python?
Correct answer
B. The first imports the module; the second imports specific names
5 views
B. The first imports the module; the second imports specific names
5 views
from x import y binds only y into the current namespace.
Asked in: Python Interview Advanced Python
https://docs.python.org/3/library/index.htmlNot sure why the answer is B? Ask here and get an explanation.