Computational Physics, Numerical Methods, Bisection, Python, Python Programming.
print("Use another guess range") return None for n in range (1,N): x_m = (x_a + x_b)/2 print('|f(x_m)| = ',abs(f(x_m))) if abs(f(x_m)) < e: return (x_m) else: if f(x_a)*f(x_m) < 0: x_b = x_m elif f(x_b)*f(x_m) < 0: x_a = x_m return (x_m) Setelah fungsi didefinisikan, kita dapat memanggil fungsi