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 functions with an example.

This program allows the user to enter any integer value. Next, this Python 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))
Python Program to find the Square root of a Number using sqrt()

Python Program to find the Square root of a Number using pow()

In this Python example program, we use 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 the Square root of a Number using math pow() function