Python Program to find Square root of a Number

Write a Python Program to find the Square root of a Number using the sqrt and pow function with an example.

This 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().

import math

num = float(input(" Please Enter any numeric Value : "))

squareRoot = math.sqrt(num)

print("The Result Of {0}  = {1}".format(num, squareRoot))
 Please Enter any numeric Value : 64
The Result Of 64.0  = 8.0

Using pow()

In this Python example program, we are using the pow() function to find the square root of a number. Remember, √number = number½

# 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))
Python Program to find Square root of a Number 2