The Python sqrt function is one of the Python Math function which is used to find the square root of a specified expression or an individual number. In this article we will show you, How to use sqrt() function in Python Programming language with example.

The basic syntax of the sqrt Function in Python Programming Language is as shown below:

Math.sqrt(number);

**Number:** It can be a number or a valid numerical expression.

- If the
*number*argument is positive integer, sqrt() function will return the square root of a given value. - If the
*number*argument is Negative integer, sqrt() function returns**ValueError** - and, if the
*number*argument is not a number, sqrt() function will return**TypeError.**

## Python sqrt Function Example

The Python sqrt function is used to find the square root of a given number. In this example, We are going to find the square root of different data types and display the output

# Python SQRT Function import math Tup = (10.98, 20.26, 30.05, -40.95 , 50.45) # Tuple Declaration Lis = [-10.98, 32.65, -39.59, -42.15 , 35.97] # List Declaration print('Square Root of Positive Number = %.2f' %math.sqrt(10)) print('Square Root of Negative Number = %.2f' %math.sqrt(25)) print('Square Root of Tuple Item = %.2f' %math.sqrt(Tup[2])) print('Square Root of List Item = %.2f' %math.sqrt(Lis[4])) print('Square Root of Multiple Number = %.2f' %math.sqrt(10 + 45 - 10)) print('Square Root of String Number = ', math.sqrt('Python'))

**OUTPUT**

**ANALYSIS**

- At the beginning, We declared Python List and Tuple with some random values.
- Within the first two statements, We used the sqrt() Function directly on Positive integers.
- Next two statements, We used the sqrt() Function on Tuple and List items. If you observe the above screenshot, sqrt() function is working perfectly on them.
- Next statement, We tried Python sqrt() Function directly on multiple values
- Next statement, We tried sqrt() Function on String value. As we said before, this will return
as output**TypeError** - Last, we checked the sqrt function against the negative values and as we said before, it is displaying the
as output**ValueError**