from tkinter import *


def clear():
    entry1.delete(0,END)


def cb(msg):
    entry1.insert(0,msg)


build = ['1','2','3','+']

#функция рассчета
def calculator():
    res = entry1.get()
    entry1.delete(0,END)
    entry1.insert(0, eval(res))

def insert():

    entry1.insert(0,str(res))


#окно
window = Tk()
window.title('calculator')
window.geometry('300x400')
window.configure(background='gray55')
#кнопка =
btn_equally = Button(window, text = '=', command=calculator, background='yellow',font='Arial 18',activebackground='yellow')
btn_equally.pack()
#кнопка очистить
btn_clear = Button(window, command=clear, bg='red', text='clear',font='Arial 18',activebackground='red')
btn_clear.pack()
#поле ввода примера
entry1 = Entry(window,width=11,font='Arial 24')
entry1.pack()
#кнопки
for b in build:
    buttons = Button(window, text=build, command=lambda param=b: cb(param))
    buttons.pack()
window.mainloop()