Square root of number python

Use the math module instead of the cmath module; the latter is for complex numbers only: >>> import math >>> print math.sqrt(25) 5.0 For what it’s worth, the cmath result is correct, if you expected a complex number. You could take just the .real component of the result, but since there is a regular floating … Read more