How to Solve NameError: name 'cmath' is not defined

Solution: Import the 'cmath' module

To Solve the error, add the following line to the top of your code.

import cmath

 

For more information:
Python cmath