def balayage2(f,k,a,b,n): fa,fb=f(a),f(b) for i in range(1,n+1): h=10**(-i) x=a if fak: x=x+h a=x-h return (round(x-h,n),round(x,n))