Square root of number python
Question: Here's my code:

    
    
    import cmath
    root = (cmath.sqrt(25))
    print (root)
    raw_input()
    

The problem i face is the result of root is 5+0j which is undesirable i only
want the square root. How can i fix this?


Answer: 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 point equivalent in the `math` module there is no
point in having your computer do the extra work.

