-1

When i press any number in my calculator showing error

from tkinter import *

def btnclick (numbers):
    global operator
    operator=operator + str(No)
    text_Input.set(operator)

def btnClearDisplay():
    global operator
    operator=""
    text_Input.set("")

def btnEqualsInput():
     global operator
     sumup=str(eval(operator))
     text_Input.set(sumup)
     operator=""

Error:

line 5, in btnclick
    operator=operator + str(No)
NameError: name 'No' is not defined
deadshot
  • 8,881
  • 4
  • 20
  • 39
jai_kumar
  • 31
  • 2
  • 14
  • 1
    Uh... yeah. `No` isn't defined. What did you expect `No` to refer to when you wrote `operator=operator + str(No)`? – user2357112 May 24 '20 at 04:59

2 Answers2

2

Try this: operator = operator + str(numbers) because your function parameter is numbers.

pyOliv
  • 1,253
  • 1
  • 6
  • 21
0

Correct this numbers

operator=operator + str(numbers)

After run your programs

jai_kumar
  • 31
  • 2
  • 14