from math import e


def eterms(tol=0.001):
    """
    Find the number of terms needed to approximate e to the given tolerance
    """

    terms = 1
    approx = 1
    fact = 1
    while abs(approx - e) > tol:
        fact = fact * terms      # Factorial of the number of terms
        approx = approx + 1/fact
        terms = terms + 1
    return terms