Open lesson

Mission: compare two cards without mixing them

Command palette

This mission workspace keeps code and notes in this browser tab. Export them before closing it. Running code is practice, not an automatic grade for the mission.

Brief

Represent a receipt with a Python dictionary and read its fields without inventing missing ones.

Mara and Imani lay out R31, which says “2 parts received, source warehouse,” and R32, which says “1 part checked” with no source written. Voss adds 2 and 1 and announces three parts released. Create a representation Noor can reread tomorrow before that claim spreads.

Your mission

  1. Write a dictionary for R31 with ID, action, quantity, and source, and one for R32 with only known fields.
  2. Put both in a receipts list and give receipts[0]['quantity'].
  3. Ask for R32's source with get() and explain the result.
  4. Write an honest sentence keeping “received,” “checked,” and “released” apart.

How to check your work

  • Each dictionary describes one receipt with correct action and quantity.
  • You get 2 for the first receipt's quantity.
  • R32's missing source stays absent; get('source') gives None.
  • You do not add different actions to invent three releases.

Code

Use Tab to leave the editor. Ctrl+Enter runs the source. The lines beginning with # are task reminders. Python ignores them. Write your code beneath them.

Python console

Loading laboratory…

Explore Python or SQL here; this is not an operating-system shell.

This is a disposable browser experiment. The code run here is not recorded as a completed mission.

Each command starts a fresh disposable worker: it runs a captured copy of your current source, then your command with the lesson fixtures. Changes are discarded afterward. Commands never save source or award XP. Ctrl+Enter executes the command.

Virtual workspace files

Source and declarative assets are readable here without JavaScript. Python input files are created at runtime; SQL setup initializes the disposable database.

source.py

Current editor source. Inspection shows your current edits.

# Write a dictionary for R31 with ID, action, quantity, and source, and one for R32 with only known fields.
# Put both in a `receipts` list and give `receipts[0]['quantity']`.
# Ask for R32's source with `get()` and explain the result.
# Write an honest sentence keeping “received,” “checked,” and “released” apart.