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.

## Syntax of a Python SQRT Function

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 will return**ValueError** - and, if the
*number*argument is not a number, Python 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 CODE**

# 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 Python 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**

Thank You for Visiting Our Blog