Import: It is simplest and most common way to use modules in our code

Import: It is simplest and most common way to use modules in our code.
Syntax:
import modulename1 [, module name 2, ---------]
Example: Input any number and to find square and square root.

Example:

import math
x = input ("Enter any number")
y = math.sqrt(x)
a = math.pow(x,2)
print "Square Root value=",y
print "square value=",a


output:
Enter any number25
Square Root value= 5.0

square value= 625.0

No comments:

Post a Comment