def f(x):
    return(2-x**2)

def rect(n,a,b):
    s=0
    S=0
    h=(b-a)/n 
    for k in range (n):
        s=s+f(a+h*k)*h
    for k in range (1,n+1):
        S=S+f(a+h*k)*h
    return (S,"<I<",s)
valeur_n=
valeur_a=
valeur_b=
print(valeur_n,valeur_a,valeur_b)

Embed on website

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