T
T
total_marks = sum(marks)
percentage = total_marks / 5
grade = "A+" if percentage >= 90 else "A" if percentage >= 80 else
"B" if percentage >= 70 else "C" if percentage >= 60 else "D" if
percentage >= 50 else "F"
except ValueError:
messagebox.showerror("Input Error", "Please enter valid marks
(0-100).")
except ValueError:
messagebox.showerror("Error", "Please enter valid data before
saving.")
# GUI Setup
root = tk.Tk()
root.title("Student Report Card")
root.geometry("400x500")
root.config(bg="light blue")
# Title Label
tk.Label(root, text="Student Report Card", font=("Arial", 16, "bold"),
bg="light blue").pack(pady=10)