Library › Coding AI › High school students

Make a 'what does this print?' quiz on Python dictionaries

Practice: Keeping the AI to your sources. About 5 minutes.

About this exercise

Make yourself a practice quiz from your class notes on dictionaries. Exactly 5 numbered questions, each written as 'What does this print? `...`' with a one-line snippet in backticks; then a line 'Answers' and 5 numbered answers that are only the printed output. Include one question on .get with a default and one that loops over a dict, using your teacher's correction about order. No code blocks, under 150 words.

Common mistakes when you ask AI for this

  • Missing the correction. The crossed-out line is still in your notes, and the AI may write a question saying dict order is random. Try: Add: "Use the correction: dicts keep insertion order."
  • Mixed question types. The AI writes true/false, fill-in and essay questions you won't see on Friday. Try: Show it: "Each question like: What does this print? `print(pets.get(\"fish\", 0))`".
  • Skipping the tricky parts. The AI may not test .get defaults, which is the part people miss. Try: Add: "Include one question on .get with a default."
  • Answers mixed in or explained. The AI puts answers under each question with explanations, or adds code blocks. Try: Add: "Then a line 'Answers' and 5 numbered answers, output only. No code blocks."

What a strong prompt includes

  • Sets the number of questions
  • Shows the question shape
  • Asks for the tricky parts
  • Mentions the correction
  • Separates the answers

Practice this now ↑

Related exercises