Find the Square Root of a Complex Number in Python

This program is about how to find the square root of a complex number in Python. There are some different ways to find the square root of a number in Python, but this program will focus on finding the square root of a complex number in Python. If you need to do this, the following are some potential solutions:

Python Program to Find the Square Root of a Complex Number

# Python program to find square root of complex number

# Import cmath Library
import cmath 

# cmath.sqrt() Return the square root of a complex number
print (cmath.sqrt(2 + 3j))
print (cmath.sqrt(15))

Output :

(1.6741492280355401+0.8959774761298381j)
(3.872983346207417+0j)

About The Author

Leave a Reply