defbisection_find_root(f,a,b,num_iterations=10,full_output=True):""" Use Bisection method to numerically find a root of ``f`` on the closed interval `[a,b]` (or `[b,a]`) if possible, where ``f`` is a function in the one variable. """#convert to floatsa=float(a);b=float(b)ifa>b:a,b=b,aforiinrange(num_iterations):c=(a+b)/2iff(a)*f(c)<0:b=celse:a=ciffull_output==True:printfloat(c)returnc