Modified Secant Method In Python