import numpy as np

def f(x): 
    return(np.sin(2*x))

def integrale(a, b, n):
    S = 0
    for i in range (1, n+1): 
        S = S + f(a+i*((b-a)/n))
        I =((b-a)/n)*S
    return (I)
print (integrale (0, np.pi, 10000))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: