Act as my Python tutor. Teach me so I can explain and write the code myself, rather than copying solutions. My current level: [CURRENT LEVEL] What I want to build or learn: [LEARNING GOAL] Time available each week and target date: [SCHEDULE] What I already know or have tried: [PRIOR KNOWLEDGE AND ATTEMPTS] My tools and environment: [PYTHON VERSION AND SETUP] First, make a learning path of 6-10 short lessons ordered by prerequisite, with a concrete outcome for each lesson. Include only concepts needed for my goal. For each lesson, provide: a 2-4 sentence explanation; one small runnable example; a “predict the output” question; one exercise I must attempt before seeing help; and a test or expected behavior I can use to check my work. When I paste code or an error, do not immediately give a complete replacement solution. First identify the smallest relevant concept, ask me one diagnostic question or give one targeted hint, then show a corrected version only after I attempt it or request the answer. Explain the error’s cause, not just the fix. Use standard Python conventions: meaningful names, small functions, explicit inputs and return values, and no unnecessary classes. For any project work, split features into a minimal working version, tests or manual checks, and one next improvement. Do not invent library behavior, commands, or output; say when you are uncertain and direct me to verify the official documentation. Before answering, check that every exercise can be completed with my stated setup and that the lesson sequence does not skip a prerequisite. Ask up to 3 clarifying questions only if a required input is missing.
Fill in
| Placeholder | What to enter | Example |
|---|---|---|
| [CURRENT LEVEL] | Describe your Python experience and any related programming knowledge. | Beginner; I understand variables, lists, loops, and simple functions but have not used files or APIs. |
| [LEARNING GOAL] | State the specific skill or small project you want to learn or build. | Build a command-line expense tracker that saves transactions to a CSV file and shows monthly totals. |
| [SCHEDULE] | Enter your weekly study time and a target date or pace. | Four 45-minute sessions each week for six weeks. |
| [PRIOR KNOWLEDGE AND ATTEMPTS] | List concepts you know, courses completed, and code or errors you have already tried. | I completed two introductory lessons and wrote a loop that totals a list; I have not used the csv module. |
| [PYTHON VERSION AND SETUP] | Enter your Python version, editor, operating system, and any libraries you can use. | Python 3.12 on macOS, VS Code, terminal access, standard library only. |
How to use
- Set one narrowly defined outcome, such as parsing a CSV file or building a command-line tool, instead of asking to learn all of Python.
- Paste the prompt, then attempt each prediction and exercise before asking for the answer.
- Run examples in your local environment and paste the exact traceback or unexpected output if you get stuck.
- Follow up with: “Here is my attempt and its output. Give me one hint first, then wait for my revision.”
Variations
Debugging coach
Use this when your code runs incorrectly and you want to learn from the fix.
Help me debug this Python code without replacing it immediately. My goal is [EXPECTED BEHAVIOR]. Here is the code: [CODE]. Here is the exact output or traceback: [ERROR OR OUTPUT]. First explain which line or assumption to inspect, then ask me one question or give one hint. After my attempt, explain the root cause and show the smallest correction. Include one small test case that would have caught this bug. Do not guess about omitted code or library behavior.
Interview practice
Use this when preparing for Python coding interviews.
Create a Python interview-practice session for [ROLE LEVEL] focused on [TOPICS]. My available time is [TIME LIMIT]. Give me three increasingly difficult problems, one at a time. For each, provide constraints, examples, and what a good solution should optimize. Do not reveal the solution until I describe my approach. Then assess correctness, edge cases, time complexity, space complexity, and Python-specific pitfalls. Do not claim an optimal solution unless you can justify it.
Code review lesson
Use this when you want feedback on a program you wrote.
Review my Python program as a teaching exercise. The program’s purpose is [PROGRAM PURPOSE]. Here is the code: [CODE]. My experience level is [CURRENT LEVEL]. Return: strengths; the three highest-value improvements; bugs or edge cases; suggested tests; and a revised small excerpt only where useful. Explain each change in plain language. Preserve working behavior and do not introduce packages I have not approved. Flag any recommendation that depends on assumptions about missing requirements.
Tips
- Choose a project with a visible result, such as a file parser or command-line tracker, because it forces you to connect syntax, data flow, and error handling.
- Read tracebacks from the bottom upward: the exception type and final message usually identify the immediate failure before the call stack explains how you reached it.
- Write a tiny test for empty input, one normal input, and one boundary case before adding features; these cases expose most beginner logic errors.
- Ask the AI to compare two approaches after you attempt one, rather than asking it to generate a large program from the start.
FAQ
Will learning Python with ChatGPT make me dependent on it?
It can if you accept full solutions. Use prediction questions, exercises, and hint-first debugging so you practice retrieval and reasoning.
Should I learn frameworks before Python basics?
Learn functions, collections, control flow, files, errors, and basic testing first; then choose a framework tied to a project goal.
Can AI run my code?
Sometimes it can reason about pasted code, but you should run it in your own environment and share the exact output for reliable debugging.