KnowledgeBoat Logo

Computer Science

Assertion. After importing a module through import statement, all its function definitions, variables, constants etc. are made available in the program.

Reason. Imported module's definitions do not become part of the program's namespace if imported through an import <module> statement.

Python Libraries

1 Like

Answer

(b)

Both Assertion and Reason are true but Reason is not the correct explanation of Assertion.

Explanation
The import <module> statement imports the entire module, making its contents available in a new namespace with the same name as the module. They do become accessible in the program's namespace through dot notation, but they are not added directly to the current namespace.

Answered By

2 Likes


Related Questions