Я бы хотел назначить каждой кнопке по умолчанию целое число, как очень простой калькулятор, но кнопка вычисления не работает
from tkinter import *
master = Tk()
def callback():
a = 1
def callback1():
b = 2
def callback2():
c = 3
def callback3():
print (a+b+c)
#this button have a value of number 1
bt1 = Button(master, text= "1", command= callback)
bt1.pack()
bt2 = Button(master, text= "2", command= callback1)
bt2.pack()
bt3 = Button(master, text= "3", command= callback2)
bt3.pack()
# this button is for printing the result
bt4 = Button(master, text= "calculate", command= callback3)
bt4.pack()
mainloop()