sqrt() Function
We can calculate square root in Python using the sqrt() function from the math module. In this example, we are calculating the square root of different numbers by using sqrt() function.
Python3
# Python3 program to demonstrate the # sqrt() method # import the math module import math # print the square root of 0 print (math.sqrt( 0 )) # print the square root of 4 print (math.sqrt( 4 )) # print the square root of 3.5 print (math.sqrt( 3.5 )) |
Output
0.0 2.0 1.8708286933869707
Python math.sqrt() function | Find Square Root in Python
sqrt() function returns square root of any number. It is an inbuilt function in Python programming language.
In this article, we will learn more about the Python Program to Find the Square Root.