Newton Raphson Method Python Coding