Easy Tutorial
❮ Python Func Sorted Ref Math Atanh ❯

Python math.sqrt() Method

Python math Module

The math.sqrt(x) method in Python returns the square root of x.

The number must be greater than or equal to 0.

Syntax

The syntax for the math.sqrt() method is as follows:

math.sqrt(x)

Parameter Description:

Return Value

Returns a floating-point number representing the square root of a number.

Example

The following example returns the square root of numbers:

Example

# Import math package
import math

# Print square roots
print(math.sqrt(9))
print(math.sqrt(25))
print(math.sqrt(16))

Output result:

3.0
5.0
4.0

Python math Module

❮ Python Func Sorted Ref Math Atanh ❯