import numpy as np
def f(x):
return np.exp(x)
def integ_tz(f, x0, x1, N=1000):
s0=0.
h=(x1-x0)/N
x=x0
for i in range(0, N):
s0+=(f(x)+f(x+h))*h/2
x+=h
return s0
if __name__=='__main__':
N=1000
sum=integ_tz(f, 0, 2.5, N)
print("integral exp(x) from x=0 to 2.5: ", sum, sep='')