Mundo em Python

Sistema de Classificação de Notas

from tkinter import *
root = Tk()
root.geometry("400x300")
root.resizable(0, 0)
root.config(bg="#0f5c7a")
root.title("Sistema de Classificação de Notas") def limpar():
Nota_entrada.delete(0, END)
resultado.set("")
def app():
n = Nota.get()
if n >= 90:
mensagem = "A"
elif n >= 80:
mensagem = "B"
elif n >= 70:
mensagem = "C"
elif n >= 65:
mensagem = "D"
else:
mensagem = "F"
resultado.set(mensagem)
titulo = Label(text="Sistema de Classificação de Notas",
font=("Arial", "16", "bold"),bg="#0f5c7a",fg="#30e0e3")
titulo.place(relx=0.06, rely=0.05)
texto_sub1 = Label(text="Nota:",
font=("Arial", "15", "bold"),bg="#0f5c7a",fg="#30e0e3")
texto_sub1.place(relx=0.3, rely=0.3) Nota = IntVar()
Nota_entrada = Entry(textvariable=Nota,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Nota_entrada.place(relx=0.55, 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.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.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.65, 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.05, rely=0.7, relwidth=0.9,relheight=0.2)
root.mainloop()
0