Write a Python Program to find the Square root of a Number using the sqrt and pow functions with an example.
This Python program allows the user to enter any integer value. Next, this program finds the square root of that number using a math function called sqrt(). Please refer to the Python sqrt function from the available Python math functions.
import math
num = float(input(" Please Enter any numeric Value : "))
squareRoot = math.sqrt(num)
print("The Result Of {0} = {1}".format(num, squareRoot))

Program to find the Square root of a Number using pow()
In this example program, we use the pow() function to find the square root of a number. Remember, √number = number½. For more examples, refer to the Python Basic Programs. Also, check out the Python pow function.
# Using pow function
import math
number = float(input(" Please Enter any numeric Value : "))
squareRoot = math.pow(number, 0.5)
print("The Square Root of a Given Number {0} = {1}".format(number, squareRoot))

Also Read