Here I am using python 2.7.3 and I have added NumPy and SciPy libraries to my Python,
You can find the root of a function easily like this:
>>> import numpy as np # importing numpy module
>>>from scipy.optimize import root # importing optimization part of scipy module
>>> def func(x): # define a function to find the root
… return x + 2 * np.cos(x) # here we chose f(x) = x + 2Cos(x)
>>> sol = root(func,0.3) # root command with the range argument
>>> sol.x # x = array([-1.02986653])
>>>sol.fun # fun = array([-6.66133815e-16])

Reference : Scipy Reference Guide