c10ex123p.py

Created by manuel-eleve-tle-specialite-indice2020

Created on May 29, 2020

284 Bytes


from math import *

def somme():

    S=0

    x=-1

    h=0.2

    for i in range(1,6):

        x=x+h

        S=S+h*exp(x)

    return(S)



def somme(n):

    S=0

    x=-1

    h=1/n

    for i in range(1,n+1):

        x=x+h

        S=S+h*exp(x)

    return(S)