import functions, classes , objects ,variables from a module. Lets try to import few mathematical functions for math module
General import Syntax
Lets import all function from math module
Lets try to import only pow function from math module
>>> from math import pow
>>> pow(2,3)
8.0
>>> exp(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'exp' is not defined
>>>
In the above example exp is not imported thats the reason we received an error
Lets try to import pow,exp from math module
>>> from math import pow,exp
>>> pow(2,3)
8.0
>>> exp(1)
2.718281828459045
>>> ceil(2.3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ceil' is not defined
Note: Though we have ceil function in math module but we are unable to use it because we didn't import it
Lets import math and sys Modules
Note: argv is attribute from sys module