Home >>Python math Module >Python math.sqrt() Method
Python math.sqrt() method in python is used to returns square root of a given number and it accepts a positive number (integer or float).
Syntax:math.sqrt(x)
Parameter | Description |
---|---|
x | It is required a number to find the square root |
import math
print (math.sqrt(6))
print (math.sqrt(14))
print (math.sqrt(20))
import math
a = 5
b = 234
c = 14.45
d = 37
e = 0
print("square root of ", a, " is = ", math.sqrt(a))
print("square root of ", b, " is = ", math.sqrt(b))
print("square root of ", c, " is = ", math.sqrt(c))
print("square root of ", d, " is = ", math.sqrt(d))
print("square root of ", e, " is = ", math.sqrt(e))