Python Program to find Square root of a Number

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

This program allows the user to enter any number. Next, this Python square root program finds the square root of that number using a math function called sqrt()

# Python Program to find Square root of a Number

import math

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

squareRoot = math.sqrt(number)

print("The Square Root of a Given Number {0}  = {1}".format(number, squareRoot))
 Please Enter any numeric Value : 64
The Square Root of a Given Number 64.0  = 8.0

Python Square root of a Number using pow()

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

# Python Square root program

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 square root output

Python Program to find Square root of a Number 2