Why is my variable not changing its value?

So I am working on this code that calculates the value of e using Taylor's serie. This is the code I have:

e=2.71828182845

def calc_sum(X):
    Result = 1
    N = 1
    while abs(e-Result)>X:
        if N==150:
            break
        Result += (X**N)/fact(N)
        N += 1
    return Result

def fact(X):
    A=1
    while X!=1:
        A*=X
        X-=1
    return A

The problem here is that it stops when N reaches 150, like it should, but it returns Result + the value of X... so for some reason the only thing that it its doing is adding 1 to the X, and I get no error. Thank you in advance!