Какую простейшую функцию для каждого действия по типу "+-*/" можно написать, чтобы калькулятор работал
from cgitb import enable
from distutils import command
from tkinter import *
from turtle import right
from tkinter import messagebox
#root
root=Tk()
root.title('Calculator')
root.geometry('340x300+900+200')
root.resizable(width=FALSE, height=FALSE)
root.configure(bg="#303c3f")
#label
mathtext=Entry(text="", bg="#303c3f", fg="#a6aaab", font="Arial40", justify=RIGHT)
#def
def ravn():
mathtext.insert(END, "=")
mathtext.delete(0, END)
def click1():
mathtext.insert(END, "1")
def clickac():
mathtext.delete(0, END)
btndot["state"]=NORMAL
btnplus["state"]=NORMAL
def click2():
mathtext.insert(END, "2")
def click3():
mathtext.insert(END, "3")
def click4():
mathtext.insert(END, "4")
def click5():
mathtext.insert(END, "5")
def click6():
mathtext.insert(END, "6")
def click7():
mathtext.insert(END, "7")
def click8():
mathtext.insert(END, "8")
def click9():
mathtext.insert(END, "9")
def click0():
mathtext.insert(END, "0")
def clickdot():
mathtext.insert(END, ".")
btndot["state"]=DISABLED
def clickplus():
mathtext.insert(0, "-")
btnplus["state"]=DISABLED
def x():
mathtext.insert(END, "x")
def minus():
mathtext.insert(END, "-")
def plus():
mathtext.insert(END, "+")
def divide():
mathtext.insert(END, "/")
#buttons
btnac=Button(text="AC", font=15, padx=30, pady=10, command=clickac)
btnplus=Button(text="+/-", font=15, padx=30, pady=10, command=clickplus)
btnproc=Button(text="%", font=15, padx=30, pady=10)
btndiv=Button(text="/", font=15, padx=39, pady=10, bg="#f57d0f", command=divide)
btn7=Button(text="7", font=15, padx=37, pady=10, command=click7)
btn8=Button(text="8", font=15, padx=34, pady=10, command=click8)
btn9=Button(text="9", font=15, padx=32, pady=10, command=click9)
btncomp=Button(text="X", font=15, padx=36, pady=10, bg="#f57d0f", command=x)
btn4=Button(text="4", font=15, padx=37, pady=10, command=click4)
btn5=Button(text="5", font=15, padx=34, pady=10, command=click5)
btn6=Button(text="6", font=15, padx=32, pady=10, command=click6)
btnmin=Button(text="-", font=20, padx=39, pady=10, bg="#f57d0f", command=minus)
btn1=Button(text="1", font=15, padx=37, pady=10, command=click1)
btn2=Button(text="2", font=15, padx=34, pady=10, command=click2)
btn3=Button(text="3", font=15, padx=32, pady=10, command=click3)
btnplus2=Button(text="+", font=20, padx=37, pady=10, bg="#f57d0f", command=plus)
btn0=Button(text="0", font=15, padx=82, pady=10, command=click0)
btndot=Button(text=".", font=15, padx=34, pady=10, command=clickdot)
btnravn=Button(text="=", font=15, padx=37, pady=10, bg="#f57d0f", command=ravn)
#grid
mathtext.grid(row=0, column=0, ipadx=53, columnspan=4)
btnac.grid(row=1, column=0)
btnplus.grid(row=1, column=1)
btnproc.grid(row=1, column=2)
btndiv.grid(row=1, column=3)
btn7.grid(row=2, column=0)
btn8.grid(row=2, column=1)
btn9.grid(row=2, column=2)
btncomp.grid(row=2, column=3)
btn4.grid(row=3, column=0)
btn5.grid(row=3, column=1)
btn6.grid(row=3, column=2)
btnmin.grid(row=3, column=3)
btn1.grid(row=4, column=0)
btn2.grid(row=4, column=1)
btn3.grid(row=4, column=2)
btnplus2.grid(row=4, column=3)
btn0.grid(row=5, column=0, columnspan=2)
btndot.grid(row=5, column=2)
btnravn.grid(row=5, column=3)
root.mainloop()