CBSE Class 12 Computer Science Question 20 of 62

Using Python Libraries — Question 5

Back to all questions
5
Question

Question 5

Which command(s) modifies the current namespace with the imported object name ?

  1. import <module>
  2. import <module1>, <module2>
  3. from <module> import <object>
  4. from <module> import *
Answer

from <module> import <object>
from <module> import *

Reason

  1. from <module> import <object>— This syntax is used to import a specific object from a module into the current namespace.
  2. from <module> import * — This syntax is used to import all objects from the module into the current namespace.