Math Functions

math.sqrt()

Compute the nonnegative real square root. For negative real inputs use cmath.sqrt if a complex result is intended.

Formal Syntax & Structure

python syntaxpython
math.sqrt(x, /)

Parameters & Attributes

NameTypeDescription
xreal numberInput real value.

Return Value

float

Floating-point result; finite precision and domain restrictions apply.

Working Example

Example Snippetpython
import mathprint(math.sqrt(81))
Python Reference