Hello, I'm new to coding, and i'm trying to code a button that rolls a dice on the click of a button. But everytime i click the button, instead of it replacing the initial roll, it creates new text underneath it. I'm not sure what i'm doing wrong and i need help haha.
Here is my code:
import customtkinter as ctk
import random
def button_callbck():
dice = random.randint(1, 6)
if dice in (1,2,3,4,5,6):
label = ctk.CTkLabel(Tapp, text = ("You rolled a " + str(dice) + "!"))
label.pack( pady=55)
Tapp = ctk.CTk()
Tapp.title("Roll the dice")
button = ctk.CTkButton(Tapp, text="Roll the dice.", command=button_callbck)
button.pack(padx=20, pady=50)
Tapp.mainloop()