From ab6d476891ff4ab1a4661490450748d00d535f08 Mon Sep 17 00:00:00 2001 From: alexpolo1 Date: Fri, 15 Aug 2025 10:26:27 +0200 Subject: [PATCH] Refactor ask_next_question to consolidate nonlocal variable declarations --- main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.py b/main.py index 8a18186..2f3796c 100644 --- a/main.py +++ b/main.py @@ -364,8 +364,7 @@ def show_timer(minutes, questions_file, session_log, total_time, xp, level, root question_frame.pack(pady=10) def ask_next_question(): - nonlocal question_idx, total_questions - nonlocal total_correct, total_questions + nonlocal question_idx, total_questions, total_correct if question_idx >= len(questions_to_ask): # Show score page at end total_score = int((total_correct / total_questions) * max_score) if total_questions else 0