How can we import a module in Python?
Answer:
There are 2 ways to import a module in python:
Using import
Syntax:
import <module_name1>[,<module_name2>,.....,<module_namen>]
Example:
import math,random
Using from
Syntax:
from <module_name> import <function1>[,<function2>,…<functionn>]
Example:
from math import pi