pythonalgorithmnumberscal

NameError: name 'No' is not defined


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

Solution

  • Correct this numbers

    operator=operator + str(numbers)
    

    After run your programs