def g(x): return -0.04*x**3+7.2*x**2-240*x+3000 def temp(): x=20 y=g(x) while y<5000 : x=x+1 y=g(x) return x