Python Tutorial Python Advanced Python References Python Libraries

Python math - sqrt() Function



The Python math.sqrt() function returns the square root of the given non-negative number.

Syntax

math.sqrt(x)

Parameters

x Required. Specify a number.

Return Value

Returns the square root of the specified number.

Example:

In the example below, sqrt() function is used to find out the square root of the given number.

import math

print(math.sqrt(25))
print(math.sqrt(30))
print(math.sqrt(50))
print(math.sqrt(100))

The output of the above code will be:

5.0
5.477225575051661
7.0710678118654755
10.0

❮ Python Math Module