Hello!
I can't get this code to work, what is wrong?
If I type:
Shouldn't I get a value in return?
This is the error massage:
TypeError: 'float' object is not callable
This is the function definition: ->
I can't get this code to work, what is wrong?
If I type:
Code:
>>>derivative(math.sin, math.pi, 0.0001)
This is the error massage:
TypeError: 'float' object is not callable
This is the function definition: ->
Code:
def derivative (f,x,h):
import math
return float(1/(2*h)) * (f(x+h) - f(x-h))
Comment