![](https://static.wixstatic.com/media/0f65e1_724a1e35eb3d48f4b1d7fd5aab01c43d~mv2.png/v1/fill/w_693,h_475,al_c,q_85,enc_auto/0f65e1_724a1e35eb3d48f4b1d7fd5aab01c43d~mv2.png)
In this, we will learn 3 different ways to find the Square root of a number in Python
Using Exponent
Using math.sqrt()
Using math.pow()
Flowchart
![](https://static.wixstatic.com/media/0f65e1_bb8e7e5ba7da49b9ad72b0355be6e713~mv2.png/v1/fill/w_619,h_859,al_c,q_90,enc_auto/0f65e1_bb8e7e5ba7da49b9ad72b0355be6e713~mv2.png)
Method 1: Using Exponent
Here we are using the exponent (**) sign, which is used to find out the power of a number.
Code:
number = int(input("Enter a Number: "))
sqrt = number ** 0.5
print("Square Root of given Number is:", sqrt)
Output:
![](https://static.wixstatic.com/media/0f65e1_464ec022e0954056b8f9e489f0f55c6f~mv2.png/v1/fill/w_805,h_103,al_c,q_85,enc_auto/0f65e1_464ec022e0954056b8f9e489f0f55c6f~mv2.png)
Method 2: Using math.sqrt()
sqrt() is the predefined method used to find square root in python. But we have to import the math module to use the sqrt() method.
Code:
import math
number = int(input("Enter a Number:"))
sqrt = math.sqrt(number)
print("Square Root of given Number:" , sqrt)
Output:
![](https://static.wixstatic.com/media/0f65e1_a747fe47241445f1b410a8703d8528e2~mv2.png/v1/fill/w_792,h_112,al_c,q_85,enc_auto/0f65e1_a747fe47241445f1b410a8703d8528e2~mv2.png)
Method 3: Using math.pow()
pow() is also a predefined method to find out the power of a number, it takes two arguments as input, the first is the number itself and the second one is the power of that number.
Code:
import math
number = int(input("Enter a Number:"))
sqrt = math.pow(number, 0.5)
print("Square Root of given Number: ", sqrt)
Output:
![](https://static.wixstatic.com/media/0f65e1_b63a0de1512d43d8bcf815e3739f40a7~mv2.png/v1/fill/w_792,h_117,al_c,q_85,enc_auto/0f65e1_b63a0de1512d43d8bcf815e3739f40a7~mv2.png)
The Tech Platform
Comments