Newton Raphson Method Code In Python