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
| Name | Type | Description |
|---|---|---|
| x | real number | Input real value. |
Return Value
float
Floating-point result; finite precision and domain restrictions apply.
Working Example
Example Snippetpython
import mathprint(math.sqrt(81))