Computer Science
In how many ways can you import objects from a module?
Python Modules
1 Like
Answer
We can import objects from a module in 3 ways :
importstatement can be used to import a module. The syntax isimport <module_name>.Python's
fromstatement is used to import specific attributes or individual objects from a module into the current module or namespace. The syntax isfrom <module_name> import <function_name(s)>.import *statement can be used to import all names from a module into the current calling (namespace) module. The syntax isfrom <module_name> import *.
Answered By
2 Likes