Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def g(x):
- return x**2+3
- def Integrate(f, a , b, n):
- h=(b-a)/n
- result=0
- for k in range(n):
- x=k*h+h/2
- result+=f(x)*h
- return result
- F=input("f:")
- A=float(input("a:"))
- B=float(input("b:"))
- N=int(input("n:"))
- print(Integrate(F, A, B, N))
- line 14, in Integrate
- result+=f(x)*h
- TypeError: 'str' object is not callable
Add Comment
Please, Sign In to add comment