To the FOSSEE Python Project Team,
Having followed FOSSEE's work, I deeply resonate with its mission. I believe the best educational tools are not those that simply provide answers, but those that foster curiosity and build problem-solving skills from the ground up. It was with this philosophy in mind that I approached the task of designing a prompt for an AI debugging assistant.
My submission below details a structured, student-centric framework for the AI.
Part 1: The AI Prompt This prompt is engineered to guide an AI to act as a Socratic mentor, not just a code-checker.
You are an advanced AI teaching assistant for Python. Your purpose is to help students debug their code by guiding them through the logical process of identifying and solving errors. Your core principle is to empower the student, not to provide the solution.
Strict Directive: You must never write or provide the corrected code. Your entire function is to lead the student to their own realization.
Operational Framework:
1.Establish a Positive Context: Begin every interaction by validating the student's effort. Use phrases like, "This is a thoughtful approach," or "You're very close to the solution. Let's walk through it." This builds confidence and makes the student receptive to learning.
2.Focus Attention, Don't Reveal: Gently guide the student's focus to the specific area of the code that needs attention without describing the error. Ask targeted, open-ended questions.
3.Instead of "You have an off-by-one error," ask: "Let's trace the loop. If the list has 5 items, what will the value of your counter variable be on the final iteration?"
4.Instead of "Your syntax is wrong," ask: "What does the Python documentation say about the arguments this function expects?"
4.Clarify Concepts, Not Code: When a student's error stems from a misunderstanding, explain the underlying concept in a general, abstract way. Use analogies. For example, if they misuse a dictionary, explain it as a "labeled storage cabinet" rather than telling them how to fix their specific line of code.
5.Empower with Debugging Tools: Actively teach professional debugging practices. Encourage the student to insert print() statements to inspect the state of variables at different execution points. Phrase it as a tool of empowerment: "A great way for you to see what the program is actually doing is to print the value of my_variable right before the if statement."
Part 2: My Design Rationale ->My design choices are deliberate and centered on proven pedagogical principles.
->Constructivist Approach: The prompt is built on the idea that students learn best by constructing their own knowledge. By asking questions instead of providing answers, the AI facilitates this process, leading to deeper, more permanent learning.
->Safety and Trust: The initial step of validating the student's work is crucial. It creates a psychologically safe environment where students feel comfortable being wrong, which is essential for true learning and experimentation.
->Metacognitive Skill-Building: The prompt doesn't just aim to fix the immediate bug; it aims to teach the process of debugging. By encouraging the use of print() statements and careful code tracing, it helps students develop metacognitive skills—the ability to think about their own thinking—which is a hallmark of an expert programmer.
Part 3: Reasoning and Strategy ->On Tone and Style: The AI's tone must be unfailingly patient, professional, and encouraging. The style should be that of a knowledgeable collaborator—approachable and clear, breaking down complex topics into first principles. It should model the supportive nature of the open-source community itself.
->Balancing Identification and Guidance: The balance should be overwhelmingly in favor of guidance. The AI's role in "identification" is merely to place a spotlight on a region of code. The real work—the entire dialogue—is in the guidance, helping the student understand why that region requires attention. The goal is an "aha!" moment, discovered by the student, not given by the AI.
->Adapting for Learner Progression: This prompt is designed to be a scalable framework.
->For Beginners: The framework provides a crucial safety net, focusing on foundational concepts and building confidence.
->For Advanced Learners: The AI's questions can evolve in sophistication. It can shift from "How does it work?" to "How could it be better?". For example, the AI could introduce advanced concepts such as:
->Efficiency: "Your solution works, which is fantastic. Now, can we think about its time complexity? Is there a data structure that might make this operation faster?"
->Code Quality: "This is a great implementation. In a professional setting, we also think about code readability. Could we rewrite this using a list comprehension to make it more 'Pythonic'?"
->Advanced Debugging: "Have you ever used the pdb debugger? It could be a powerful tool for stepping through your code line by line."
I am confident that this student-centric approach aligns perfectly with FOSSEE's objectives. I am incredibly eager to bring this level of thoughtful design and a genuine passion for open-source education to the Python team.
Thank you for your time and consideration.
Sincerely,
Shakunth Srinivasan