def Bisection(f, a, b, errorBound): xm = (a+b)/2 while( f(x)!=0 and (b-a) >= errorBound): if(f(a)*f(xm)<0): b = xm else: a = xm xm = (a+b)/2 return xm def f(x): return x^3-9*x+1 bisection(f,2,3,0.001) print("root=", xm,"f(x)=",f(x)) *After evaluating we get an error like: *
* File "/tmp/ipykernel_997521/4223205321.py", line 6 else: ^ SyntaxError: invalid syntax* What can I do and what is the tool that I can use? Help me Your's Varun -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/0ccec33b-da7c-4f9f-8525-8ebf2903911fn%40googlegroups.com.