Write a function
lowest_integer()
which takes 2 input arguments:
- a function
f
representing an increasing function (),- a number
fmin
,and returns an integer
nmin
such that >0 is the smallest integer that satisfies ()>.To test the function we use code like this where we define
f(n)
thenprint(lowest_integer(f, fmin))
and get the expected output:def f(n): return 2*n print(lowest_integer(f, 10)) ## 6 def f(n): return n**2 + 6*n - 3 print(lowest_integer(f, 500)) ## 20
My attempt at the code:
def lowest_integer(f, fmin):
f = fmin
nmin = n + 1
return nmin
I'm having trouble figuring out how to define the function f(n)
within the lowest_integer()
function