Program to find the square root of a number in Python
In this python program guide, we will learn to write a
-
python program to find the square root of a number
Program to find the square root of a number in Python
The program to find the square root of a number in python is as follows:
# Owner : TutorialsInhand Author : Devjeet Roy
import math
number = int(input("Enter the number: "))
ans = math.sqrt(number)
print("The sq. root is:",ans)
The output of the python program to find the square root of a number is as follows:
PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter the number: 9
The sq. root is: 3.0
Few important point about this program:
1. To find the sqaure root of a number here, we are using the math library.
2. The .sqrt() method helps us to find the sqaure root of a number in python.
Would you like to see your article here on tutorialsinhand.
Join
Write4Us program by tutorialsinhand.com
About the Author
Devjeet Roy
Full Stack Web Developer & Blockchain Enthusiast
Page Views :
Published Date :
Jan 28,2021