Jul-12-2020, 07:27 PM
Hey guys,
I am trying this code out for an assignment and keep getting "SyntaxError: invalid syntax" on the print function.
I am trying this code out for an assignment and keep getting "SyntaxError: invalid syntax" on the print function.
def f(x): return 2*x*x*x - 11.7*x*x + 17.7 * x - 5 x0 = 3 xold = 0 def modifiedsecant(x0): lamda = 0.01 i = 0 while (i < 4): xold = x0 i = i + 1 x0 = x0 - ((lamda*x0*f(x0))/(f(x0+(lamda*x0))-f(x0)) print(x0) modifiedsecant(x0)Appreciate the help.