square root
The number that multiplied by itself gives a given number, found in Python with math.sqrt(x) or x ** 0.5.
In more detail
Both give a float. math.sqrt(-1) raises ValueError because negative numbers have no real square root.
Example
from math import sqrt
sqrt(2)Related terms
- exponentiation — Raising a number to a power, written with two stars in Python: 2 ** 10 is 1024.
- math module — The standard library module of mathematical functions and constants, such as sqrt, floor, ceil, sin and pi.
Taught in
- Floats, Division And Mixed Types — Hands-on Python: Complete Video Course & Book
- Exponents, Roots And Float Formats — Hands-on Python: Complete Video Course & Book
- Modules And The Import System — Hands-on Python: Complete Video Course & Book
- A Standard Library Tour — Hands-on Python: Complete Video Course & Book