from tkinter import *
from tkinter.ttk import *

root = Tk()
root.title('Calculator')

def total(e):
  t = '{0:g}'.format(float(eval(e)))
  result.delete(0, END)
  result.insert(0, t)

result = Entry(root, text='man')
lPar = Button(root, text='(', command=lambda:result.insert(END, '('))
n7 = Button(root, text='7', command=lambda:result.insert(END, '7'))
n4 = Button(root, text='4', command=lambda:result.insert(END, '4'))
n1 = Button(root, text='1', command=lambda:result.insert(END, '1'))
n0 = Button(root, text='0', command=lambda:result.insert(END, '0'))
rPar = Button(root, text=')', command=lambda:result.insert(END, ')'))
n8 = Button(root, text='8', command=lambda:result.insert(END, '8'))
n5 = Button(root, text='5', command=lambda:result.insert(END, '5'))
n2 = Button(root, text='2', command=lambda:result.insert(END, '2'))
dec = Button(root, text='.', command=lambda:result.insert(END, '.'))
bak = Button(root, text='C', command=lambda:result.delete(len(result.get()) - 1))
n9 = Button(root, text='9', command=lambda:result.insert(END, '9'))
n6 = Button(root, text='6', command=lambda:result.insert(END, '6'))
n3 = Button(root, text='3', command=lambda:result.insert(END, '3'))
equ = Button(root, text='=', command=lambda:total(result.get()))
clr = Button(root, text='AC', command=lambda:result.delete(0, END))
div = Button(root, text='/', command=lambda:result.insert(END, '/'))
mul = Button(root, text='*', command=lambda:result.insert(END, '*'))
sub = Button(root, text='-', command=lambda:result.insert(END, '-'))
add = Button(root, text='+', command=lambda:result.insert(END, '+'))
# eval(result.get())
result.grid(row=0, columnspan=4)
lPar.grid(row=1, column=0)
n7.grid(row=2, column=0)
n4.grid(row=3, column=0)
n1.grid(row=4, column=0)
n0.grid(row=5, column=0)
rPar.grid(row=1, column=1)
n8.grid(row=2, column=1)
n5.grid(row=3, column=1)
n2.grid(row=4, column=1)
dec.grid(row=5, column=1)
bak.grid(row=1, column=2)
n9.grid(row=2, column=2)
n6.grid(row=3, column=2)
n3.grid(row=4, column=2)
equ.grid(row=5, column=2)
clr.grid(row=1, column=3)
div.grid(row=2, column=3)
mul.grid(row=3, column=3)
sub.grid(row=4, column=3)
add.grid(row=5, column=3)


root.resizable(False, False)
root.mainloop()

80a9859a56502aebcb4305f18cdfe288862e2e58
<mask token>

<mask token>
root.title('Calculator')


def total(e):
    t = '{0:g}'.format(float(eval(e)))
    result.delete(0, END)
    result.insert(0, t)


<mask token>
result.grid(row=0, columnspan=4)
lPar.grid(row=1, column=0)
n7.grid(row=2, column=0)
n4.grid(row=3, column=0)
n1.grid(row=4, column=0)
n0.grid(row=5, column=0)
rPar.grid(row=1, column=1)
n8.grid(row=2, column=1)
n5.grid(row=3, column=1)
n2.grid(row=4, column=1)
dec.grid(row=5, column=1)
bak.grid(row=1, column=2)
n9.grid(row=2, column=2)
n6.grid(row=3, column=2)
n3.grid(row=4, column=2)
equ.grid(row=5, column=2)
clr.grid(row=1, column=3)
div.grid(row=2, column=3)
mul.grid(row=3, column=3)
sub.grid(row=4, column=3)
add.grid(row=5, column=3)
root.resizable(False, False)
root.mainloop()

<mask token>
root = Tk()
root.title('Calculator')


def total(e):
    t = '{0:g}'.format(float(eval(e)))
    result.delete(0, END)
    result.insert(0, t)


result = Entry(root, text='man')
lPar = Button(root, text='(', command=lambda : result.insert(END, '('))
n7 = Button(root, text='7', command=lambda : result.insert(END, '7'))
n4 = Button(root, text='4', command=lambda : result.insert(END, '4'))
n1 = Button(root, text='1', command=lambda : result.insert(END, '1'))
n0 = Button(root, text='0', command=lambda : result.insert(END, '0'))
rPar = Button(root, text=')', command=lambda : result.insert(END, ')'))
n8 = Button(root, text='8', command=lambda : result.insert(END, '8'))
n5 = Button(root, text='5', command=lambda : result.insert(END, '5'))
n2 = Button(root, text='2', command=lambda : result.insert(END, '2'))
dec = Button(root, text='.', command=lambda : result.insert(END, '.'))
bak = Button(root, text='C', command=lambda : result.delete(len(result.get(
    )) - 1))
n9 = Button(root, text='9', command=lambda : result.insert(END, '9'))
n6 = Button(root, text='6', command=lambda : result.insert(END, '6'))
n3 = Button(root, text='3', command=lambda : result.insert(END, '3'))
equ = Button(root, text='=', command=lambda : total(result.get()))
clr = Button(root, text='AC', command=lambda : result.delete(0, END))
div = Button(root, text='/', command=lambda : result.insert(END, '/'))
mul = Button(root, text='*', command=lambda : result.insert(END, '*'))
sub = Button(root, text='-', command=lambda : result.insert(END, '-'))
add = Button(root, text='+', command=lambda : result.insert(END, '+'))
result.grid(row=0, columnspan=4)
lPar.grid(row=1, column=0)
n7.grid(row=2, column=0)
n4.grid(row=3, column=0)
n1.grid(row=4, column=0)
n0.grid(row=5, column=0)
rPar.grid(row=1, column=1)
n8.grid(row=2, column=1)
n5.grid(row=3, column=1)
n2.grid(row=4, column=1)
dec.grid(row=5, column=1)
bak.grid(row=1, column=2)
n9.grid(row=2, column=2)
n6.grid(row=3, column=2)
n3.grid(row=4, column=2)
equ.grid(row=5, column=2)
clr.grid(row=1, column=3)
div.grid(row=2, column=3)
mul.grid(row=3, column=3)
sub.grid(row=4, column=3)
add.grid(row=5, column=3)
root.resizable(False, False)
root.mainloop()

from tkinter import *
from tkinter.ttk import *
root = Tk()
root.title('Calculator')


def total(e):
    t = '{0:g}'.format(float(eval(e)))
    result.delete(0, END)
    result.insert(0, t)


result = Entry(root, text='man')
lPar = Button(root, text='(', command=lambda : result.insert(END, '('))
n7 = Button(root, text='7', command=lambda : result.insert(END, '7'))
n4 = Button(root, text='4', command=lambda : result.insert(END, '4'))
n1 = Button(root, text='1', command=lambda : result.insert(END, '1'))
n0 = Button(root, text='0', command=lambda : result.insert(END, '0'))
rPar = Button(root, text=')', command=lambda : result.insert(END, ')'))
n8 = Button(root, text='8', command=lambda : result.insert(END, '8'))
n5 = Button(root, text='5', command=lambda : result.insert(END, '5'))
n2 = Button(root, text='2', command=lambda : result.insert(END, '2'))
dec = Button(root, text='.', command=lambda : result.insert(END, '.'))
bak = Button(root, text='C', command=lambda : result.delete(len(result.get(
    )) - 1))
n9 = Button(root, text='9', command=lambda : result.insert(END, '9'))
n6 = Button(root, text='6', command=lambda : result.insert(END, '6'))
n3 = Button(root, text='3', command=lambda : result.insert(END, '3'))
equ = Button(root, text='=', command=lambda : total(result.get()))
clr = Button(root, text='AC', command=lambda : result.delete(0, END))
div = Button(root, text='/', command=lambda : result.insert(END, '/'))
mul = Button(root, text='*', command=lambda : result.insert(END, '*'))
sub = Button(root, text='-', command=lambda : result.insert(END, '-'))
add = Button(root, text='+', command=lambda : result.insert(END, '+'))
result.grid(row=0, columnspan=4)
lPar.grid(row=1, column=0)
n7.grid(row=2, column=0)
n4.grid(row=3, column=0)
n1.grid(row=4, column=0)
n0.grid(row=5, column=0)
rPar.grid(row=1, column=1)
n8.grid(row=2, column=1)
n5.grid(row=3, column=1)
n2.grid(row=4, column=1)
dec.grid(row=5, column=1)
bak.grid(row=1, column=2)
n9.grid(row=2, column=2)
n6.grid(row=3, column=2)
n3.grid(row=4, column=2)
equ.grid(row=5, column=2)
clr.grid(row=1, column=3)
div.grid(row=2, column=3)
mul.grid(row=3, column=3)
sub.grid(row=4, column=3)
add.grid(row=5, column=3)
root.resizable(False, False)
root.mainloop()

from tkinter import *
from tkinter.ttk import *

root = Tk()
root.title('Calculator')

def total(e):
  t = '{0:g}'.format(float(eval(e)))
  result.delete(0, END)
  result.insert(0, t)

result = Entry(root, text='man')
lPar = Button(root, text='(', command=lambda:result.insert(END, '('))
n7 = Button(root, text='7', command=lambda:result.insert(END, '7'))
n4 = Button(root, text='4', command=lambda:result.insert(END, '4'))
n1 = Button(root, text='1', command=lambda:result.insert(END, '1'))
n0 = Button(root, text='0', command=lambda:result.insert(END, '0'))
rPar = Button(root, text=')', command=lambda:result.insert(END, ')'))
n8 = Button(root, text='8', command=lambda:result.insert(END, '8'))
n5 = Button(root, text='5', command=lambda:result.insert(END, '5'))
n2 = Button(root, text='2', command=lambda:result.insert(END, '2'))
dec = Button(root, text='.', command=lambda:result.insert(END, '.'))
bak = Button(root, text='C', command=lambda:result.delete(len(result.get()) - 1))
n9 = Button(root, text='9', command=lambda:result.insert(END, '9'))
n6 = Button(root, text='6', command=lambda:result.insert(END, '6'))
n3 = Button(root, text='3', command=lambda:result.insert(END, '3'))
equ = Button(root, text='=', command=lambda:total(result.get()))
clr = Button(root, text='AC', command=lambda:result.delete(0, END))
div = Button(root, text='/', command=lambda:result.insert(END, '/'))
mul = Button(root, text='*', command=lambda:result.insert(END, '*'))
sub = Button(root, text='-', command=lambda:result.insert(END, '-'))
add = Button(root, text='+', command=lambda:result.insert(END, '+'))
# eval(result.get())
result.grid(row=0, columnspan=4)
lPar.grid(row=1, column=0)
n7.grid(row=2, column=0)
n4.grid(row=3, column=0)
n1.grid(row=4, column=0)
n0.grid(row=5, column=0)
rPar.grid(row=1, column=1)
n8.grid(row=2, column=1)
n5.grid(row=3, column=1)
n2.grid(row=4, column=1)
dec.grid(row=5, column=1)
bak.grid(row=1, column=2)
n9.grid(row=2, column=2)
n6.grid(row=3, column=2)
n3.grid(row=4, column=2)
equ.grid(row=5, column=2)
clr.grid(row=1, column=3)
div.grid(row=2, column=3)
mul.grid(row=3, column=3)
sub.grid(row=4, column=3)
add.grid(row=5, column=3)


root.resizable(False, False)
root.mainloop()
