Home >>Python cmath Module >Python cmath.sqrt() Method
Python method cmath.sqrt() returns a complex number with the square root.
Syntax:cmath.sqrt(x)
Parameter | Description |
---|---|
x | It is a required parameter to find the square root of a number. It returns a ValueError If the number is less than 0. It returns a TypeError if the value is not a number |
import cmath
print (cmath.sqrt(1 + 2j))
print (cmath.sqrt(12))
import cmath
print (cmath.sqrt(3 + 5j))
print (cmath.sqrt(8))