{}
run-icon
main.py
import numpy as np def f(x): y=x*x+5*x+6 return y a=float(input("Enter Intial value of a: ")) b=float(input("Enter Intial value of b: ")) if f(a)*f(b)<0: print("Root lies in the interval [{0},{1}]".format(a,b)) elif f(a)*f(b)==0: print("Any one initial value may the root") else: print("No root lies in the interval [{0},{1}]".format(a,b))
Output