How to find square root in python?

Python has a wide variety of libraries or packages which helps us in many ways.
For finding a square root of a number we have a library named as math. We can easily import it.
Math library has a function sqrt() which helps to find square root of any number.
e.g.,
import math print(math.sqrt(16))

We can find the square root of those number which is not a perfect square by this function.
e.g.,
import math a=22 print(math.sqrt(a))

In this way we can find the square root of any number.
Subscribe
Login
Please login to comment
0 Discussion