from tkinter import *
root = Tk()
root.geometry("500x400")
root.resizable(0, 0)
root.config(bg="#1d3852")
root.title("Teste")
titulo = Label(text="Teste", font=("Arial", "35", "bold"), bg="#1d3852", fg="#8bb2d9")
titulo.place(relx=0.35, rely=0.05)
texto_sub1 = Label(text="Valor A :", font=("Arial", "15", "bold"), bg="#1d3852", fg="#8bb2d9")
texto_sub1.place(relx=0.2, rely=0.3)
texto_sub2 = Label(text="Valor B :", font=("Arial", "15", "bold"), bg="#1d3852", fg="#8bb2d9")
texto_sub2.place(relx=0.2, rely=0.45)
valorA_entrada = Entry(font=("Arial", "12", "bold"), bg="white", fg="blue", justify='center')
valorA_entrada.place(relx=0.45, rely=0.3, relwidth=0.35)
valorA_entrada.focus()
valorB_entrada = Entry(font=("Arial", "12", "bold"), bg="white", fg="blue", justify='center')
valorB_entrada.place(relx=0.45, rely=0.45, relwidth=0.35)
def limpar():
valorA_entrada.delete(0, END)
valorB_entrada.delete(0, END)
texto_sub3.config(text="")
def app():
try:
a = int(valorA_entrada.get())
b = int(valorB_entrada.get())
c = (a == 2 and b != 1)
d = (a != 1 or b == 1)
e = (a != 2 or b == 1)
f = (not (a == 1))
mensagem = f"Primeiro Teste: {c}\nSegundo Teste: {d}\nTerceiro Teste: {e}\nQuarto Teste: {f}"
texto_sub3.config(text=mensagem)
except ValueError:
texto_sub3.config(text="Por favor, insira números válidos em ambas as entradas.")
print("Função app() chamada com sucesso.")
but1 = Button(text="Verificar", bd=2, bg='#107db2', fg='white', font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.05, rely=0.55, relwidth=0.25, 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.35, rely=0.55, 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.65, rely=0.55, relwidth=0.25, relheight=0.1)
texto_sub3 = Label(text="", font=("Arial", "12", "bold"), bg="#8bb2d9", fg="#1d3852")
texto_sub3.place(relx=0.05, rely=0.7, relwidth=0.9, relheight=0.25)
root.mainloop()