Back to Computer Science
Python • 9th - 12th Grade

Debug a Recursive Function

Students learn debugging skills with guided hints that lead them to the solution without giving it away.

DEBUG ASSISTANT
def factorial(n):
    if n == 0:
        return 0  # Bug here!
    return n * factorial(n-1)

Output: factorial(5) returns 0

# Expected: 120

🎯 Tutoring Goals

Why This Works

Whilst debugging code can impart some useful skills, spending many hours in the futile search for a misplaced character lacks for learning efficiency and can often lead to students giving up on coding altogether.

Peach helps by offering a Custom Tutor who understands the student's skill level, identifies bugs, bridges gaps in understanding, and helps them move faster without compromising any organic takeaways in the process.

✨ Create & Customize

Set Up Your Tutor

Choose Tutor Mode

An Assistant tutor identifies bugs to improve speed and efficiency, whereas a Socratic Tutor guides beginners to trace logic and analyse their own errors, helping them develop strong self-correcting instincts.

Socratic Tutor

For building debugging intuition

Assistant

For faster problem resolution

Auto-Generated Guidelines

When you generate a tutor outline, Peach creates all necessary guidelines – including Topics, a Knowledge Summary, and AI Roles & Rules. Teachers can fully customise the outline.

👩‍🎓 Student Experience

The Debugging Process

When students need detailed guidance, they can add code to the chat via the Code Editor. For every bug the Assistant detects, it explains the issue and provides leading questions and hints to aid learning as the student corrects mistakes independently.

💡 Unlike one-size-fits-all tools like ChatGPT that focus on fixing code directly, Peach offers a pedagogically grounded experience – guiding students through debugging to build both speed and algorithmic intuition.

Ready to teach debugging the right way?

Join teachers who are helping students build real problem-solving skills.