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-

For example

import math

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

error: Content is protected !!