# Get unstuck on a coding error with hints instead of the answer

A plain-English explanation of your error and step-by-step hints, so you learn to debug instead of copying a fix.

- Topic: Software Development
- Framework: Few-Shot
- Level: Standard
- Tags: Coding, Explain & Teach, Code, Fill-in Template, Step-by-step
- Source: https://www.thinkwithprompt.com/prompts/get-unstuck-on-a-coding-error-with-hints-instead-of-the-answer

## Prompt

```text
Help me fix a coding error, but teach me instead of handing me the fix.

**What I'm building and which step I'm on:** [PASTE THE MILESTONE FROM STEP 2, or describe it]
**Language:** [e.g. "Python 3", "JavaScript"]
**My code:** [PASTE THE RELEVANT PART - remove any passwords, API keys, or personal data first]
**Full error message:** [PASTE THE WHOLE THING, not just the last line]
**What I expected to happen:** [DESCRIPTION]
**What I've already tried:** [DETAILS]

How to help:
1. Explain in plain words what the error message means and how to read it (e.g. which line it points to and why the real cause may be earlier).
2. Give hints in escalating order: Hint 1 (where to look), Hint 2 (what's wrong there), Hint 3 (how to fix it in principle). Stop after each hint and let me try.
3. Show the corrected code only if I ask for it after the hints.
4. Fix only the problem I asked about. Don't rewrite my whole program or change my style.
5. If there's no error but the output is wrong, help me add print statements or use a debugger to compare what the code does with what I expected.

After it's solved, give me:
- A one-line rule I can remember to avoid this error.
- A general debugging habit this problem teaches.

This is step 3 of the "Learn to code by building your first project" pack. It works on its own for any beginner coding error.
```

## What to fill in

- PASTE THE MILESTONE FROM STEP 2, or describe it
- e.g. "Python 3", "JavaScript"
- PASTE THE WHOLE THING, not just the last line
- DESCRIPTION
- DETAILS

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
