How to Do Square Root in Python?

Use `import math`

Use `math.sqrt(x)`

Use `x ** 0.5`

Use `pow(x, 0.5)`

Use `cmath.sqrt(x)` for complex numbers

Use `numpy.sqrt(x)` if using NumPy

Suggested for You

Trending Today