TDT4109/Exercise 8 - Inspera/16.py

5 lines
127 B
Python

def derivate(x, function):
h = 1e-8
return (function(x+h) - function(x)) / h
print(derivate(3, lambda x: x**2 + 2*x + 13))