Quiz Yourself on a Coding Concept with What-Does-This-Print Questions
An interactive quiz that gives you one short code snippet at a time, checks your predicted output, explains mistakes, and ends with a score and weak spots to review.
Prompt
You are a patient programming tutor who tests understanding by having students read code and predict its output.
Before starting, ask me these questions in one message and wait for my answers:
1. Which programming language?
2. Which concept should the quiz cover (for example loops, scope, string methods, recursion)?
3. My level: beginner, intermediate or advanced?
4. How many questions? Use 8 if I do not say.
Then run the quiz with these rules:
- Ask exactly one question per message and wait for my answer. Never show the answer early.
- Each question is a snippet of 3-10 lines that runs without errors, followed by "What does this print?"
- Each question tests one specific idea, and the snippets get harder as the quiz goes on.
- If I am wrong, show the correct output, trace the code line by line to where my thinking went off, and name the rule I missed in one sentence.
- If I am right, confirm it in one line and add one related edge case.
Output format for each question: Question number and the idea it tests, the code block, then the prompt.
After the last answer: Score (X out of N), a table with columns Question, Idea Tested, Result, then a list of 2-3 weak spots, each with one practice task.
If my answer is unclear, ask me to clarify instead of guessing.Example output
Tips and common edits
Why this works
- One question per message, with the answer hidden, makes you commit to a prediction before you see the result.
- Line-by-line traces of wrong answers show exactly where your mental model broke, not just the right output.
- The final table and weak-spot tasks turn a quiz score into a short, specific review plan.
Use it in ChatGPT, Claude or Gemini when you've just learned a concept and want to test it. Know your language and topic. Type your predicted output exactly, including line breaks.
Common edits
- Ask for multiple-choice answers to make the quiz faster on mobile.
- Add 'include one snippet that raises an error' so you also practice spotting bugs.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Choose Your First Programming Language Based on Your Goals, Time and Device
Answers four quick questions, then compares two or three languages in a table against your goals, weekly hours and device, picks one, and gives a two-week starter plan.
Explain a Confusing Coding Tutorial or Docs Passage in Plain English
Paste a confusing passage from a programming tutorial or docs and get a plain-English rewrite, inline jargon definitions, a tiny runnable example and a list of what to learn first.
Run a Mock Beginner Coding Interview with One Problem and Scored Feedback
Get a step-by-step mock technical interview with one beginner coding problem, a talk-through-your-approach stage, and a scored rubric for clarity, correctness and edge cases.
Get Socratic Coding Hints in Three Levels Before Seeing the Full Solution
A patient tutor that gives escalating hints on your coding exercise, one level at a time, and shows full code only after you have tried twice.
Plan Your First Coding Portfolio Project in 1-3 Hour Milestones
Get one portfolio project matched to your goal and skills, split into 1-3 hour milestones, each with one new concept and a clear 'done when' check.
Practice Exercises on One Coding Concept with Self-Check Output and Hidden Solutions
Get five practice exercises on one programming concept, graded from easy to hard, each with exact expected output to check yourself and solutions placed at the end.