I'm trying to clear the entry widget after the user presses a button using tkinter in python. I tried using ent.delete(0,END) but I got an error saying that strings dont have the attribute delete
here is my code: I'm getting error on real.delete(0, END).
secret = randrange(1,100)
print(secret)
def res(real, secret):
if secret==eval(real):
showinfo(message='that is right!')
real.delete(0, END)
def guess():
ge = Tk()
ge.title('guessing game')
Label(ge, text="what is your guess:").pack(side=TOP)
ent = Entry(ge)
ent.pack(side=TOP)
btn=Button(ge, text="Enter", command=lambda: res(ent.get(),secret))
btn.pack(side=LEFT)
ge.mainloop()