|
@@ -0,0 +1,28 @@
|
|
|
+import tkinter as tk
|
|
|
+from tkinter import messagebox
|
|
|
+
|
|
|
+def calculate_grades():
|
|
|
+ grades = [5, 4, 3, 2, 3, 4, 5, 4, 5]
|
|
|
+ count_fives = grades.count(5)
|
|
|
+ result_text = f"Количество пятёрок по информатике: {count_fives}"
|
|
|
+ messagebox.showinfo("Результат", result_text)
|
|
|
+
|
|
|
+root = tk.Tk()
|
|
|
+root.title("Подсчёт пятёрок")
|
|
|
+root.geometry("300x150")
|
|
|
+
|
|
|
+label = tk.Label(root, text="Нажмите кнопку, чтобы посчитать пятёрки:")
|
|
|
+label.pack(pady=10)
|
|
|
+
|
|
|
+button = tk.Button(
|
|
|
+ root,
|
|
|
+ text="Посчитать",
|
|
|
+ command=calculate_grades,
|
|
|
+ padx=20,
|
|
|
+ pady=10,
|
|
|
+ bg="lightblue",
|
|
|
+ font=("Arial", 12)
|
|
|
+)
|
|
|
+button.pack(pady=20)
|
|
|
+
|
|
|
+root.mainloop()
|