from tkinter import * def p(): a =ef1.get() b=0 for i in a: b+=int(i) r.configure(text = str(b)) root= Tk() root.geometry('600x200+300+300') ef1=Entry(width=100) ef1.grid(column=2, row=0) bf1=Button(text="Сума цифр", width=36, height=3, command=p)#.place(x=174,y=180) bf1.grid(column=2,row=2) r = Label(root, bg='blue', fg='yellow', width=80,height=2, text='') r.grid(column=2, row=1) root.mainloop()