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))
 Please Enter any numeric Value : 64
The Result Of 64.0  = 8.0

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

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.