Python programming: NameError: name 'eplison' is not defined

def sum_epsilon(x , epsilon):

    Sum = 1

    a = eplison

    i = 1

    while a<= epsilon:

        a= xbynfact(x, i)

        Sum += a

        i += 1

    return Sum

print(sum_epsilon(2, 0.01))

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-52-116e1576d781> in <module>()
      8         i += 1
      9     return Sum
---> 10 print(sum_epsilon(2, 0.01))

<ipython-input-52-116e1576d781> in sum_epsilon(x, epsilon)
      1 def sum_epsilon(x , epsilon):
      2     Sum = 1
----> 3     a = eplison
      4     i = 1
      5     while a<= epsilon:

NameError: name 'eplison' is not defined.

And similar error for this code-

def summation(x , N):

    Sum = 1

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

        Sum = Sum + xbynfact(x , i)

    return Sum

p = 2

q = 3

Var1 = summation(p , 100) * summation(q, 100)

var2 = summation(p+q, 100)

print(var1, var2, var2-var1)


NameError                                 Traceback (most recent call last)
<ipython-input-54-408abe7d1044> in <module>()
      8 Var1 = summation(p , 100) * summation(q, 100)
      9 var2 = summation(p+q, 100)
---> 10 print(var1, var2, var2-var1)

NameError: name 'var1' is not defined

spelling mistake for epsilon

var1 / Var1 <-- Variable names are case sensitive.

2 Likes