Newton Raphson Method Python Programming