from tkinter import *
root = Tk()
root.geometry("400x300")
root.resizable(0, 0)
root.title("Verificar se é divisível por 5")
root.config(bg="#d9ead3")
def app():
n = numero.get()
if (n % 5 == 0):
mensagem =f"O número {n} é divisível por 5."
else:
mensagem = f"O número {n} não é divisível por 5."
resultado.set(mensagem)
def limpar():
numero_entrada.delete(0, END)
titulo = Label(text="Verificar se é divisível por 5", font=("Arial", "15", "bold"),
bg="#d9ead3",fg="#bf9000")
titulo.place(relx=0.15, rely=0.05)
numero_texto = Label(text="Digite o número: ",
font=("Arial", "12", "bold"),
bg="#d9ead3", fg="#bf9000", justify='center')
numero_texto.place(relx=0.15, rely=0.3, relwidth=0.4)
numero = DoubleVar()
numero_entrada = Entry(textvariable=numero,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
numero_entrada.place(relx=0.6, rely=0.3, relwidth=0.25)
but1 = Button(text="Verificar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.05, rely=0.5, relwidth=0.3, relheight=0.1)
but_limpar = Button(text="Limpar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=limpar)
but_limpar.place(relx=0.4, rely=0.5, relwidth=0.25, relheight=0.1)
but_sair = Button(text="Sair", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=root.destroy)
but_sair.place(relx=0.7, rely=0.5, relwidth=0.25, relheight=0.1)
resultado = StringVar()
resultado_texto = Label(textvariable=resultado,
font=("Arial", 12, "bold"), bg="#cfe2f3")
resultado_texto.place(relx=0.1, rely=0.7, relwidth=0.8,relheight=0.1)
root.mainloop()