from math import sin

def factorielle(n):
    if n == 0:
        return 1
    return n * factorielle(n-1)

def f(x,n):
    s = 0
    for k in range((n+1)//2):
        s += (-1)**k * x**(2*k+1) / factorielle(2*k+1)
    return s

x = 0
while abs( f(x,100) - sin(x) ) < 1:
    x += 1

print("Pour x = {}, la fonction renvoie {}; or, sin({})={}.\nLa différence est : {}".format(x, f(x,100), x, sin(x), abs(sin(x)-f(x,100))))
