Explain the difference between import and from import statement, with example.

import <module>

It import entire module and so everything inside the module will be imported like functions, constant, variables.
In this way after importing the module we can use any function of imported module as per given syntax-
module.<functionname>()

For example

import math
print(math.pi)
print(math.sum([10,20]))

from <module> import statement

from <module> import statement imports selected items , but to use these items we don’t have to prefix module name.

For example

from math import pi
print(pi)

error: Content is protected !!