from tkinter import *
def funcadd():
n3.delete(0, END)
value = int(n1.get()) + int(n2.get())
n3.insert(0, value)
def funcsub():
n3.delete(0, END)
value = int(n1.get()) - int(n2.get())
n3.insert(0, value)
root = Tk()
root.geometry("500x500")
n1 = Entry(width=500)
n2 = Entry(width=500)
n3 = Entry(width=500)
b1 = Button(text="Сложить",command =funcadd)
b2 = Button(text="Вычесть",command =funcsub)
n1.place(x = 0,y = 0)
n2.place(x = 0,y = 25)
n3.place(x = 0,y = 95)
b1.place(x = 0, y = 50)
b2.place(x = 75, y = 50)
root.mainloop()
|