Browse Source

Загрузить файлы 'ОАиП/2024-25/36гр'

u22podenny 2 weeks ago
parent
commit
f9d9f43429
1 changed files with 28 additions and 0 deletions
  1. 28 0
      ОАиП/2024-25/36гр/podennnny.py

+ 28 - 0
ОАиП/2024-25/36гр/podennnny.py

@@ -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()