← Course homeNext: Python dictionaries →Code clears when you leave
MISSION 14 · PYTHON LISTS

Manifest of Many Parcels

Read an item by its zero-based slot, then build a total by visiting every item. Empty lists are real lists with no item to read.

What’s saved: your code, predictions and answers clear when you leave this page or reload. If you turn saving on, only which puzzles you finished and how much help you used is kept on this device. Test accounts also share it, and lesson timing, with the site’s maintainer.

◇ Your mastery goalPython lists · Parcel manifests · Set A

Complete all 7 required tasks with a correct prediction, an inspected trace and an explanation that shows the concept. At least 4 must be independent checks, without answer-level help.

✓ Qualifying tasks: 0 / 7◎ Independent checks: 0 / 4 required
PRACTICE · 1 OF 7

Find one parcel

0 / 7 checks

Read the first parcel count from the manifest. Which value is stored at slot 0?

1
Read the starting collectionThese authored values are read-only inputs to your program.
slot 08slot 13slot 25slot 32

Requested slot: slot = 0

2
Predict before RunWhat value does that slot read?
3
Read from the listUse the requested slot.

Allowed: manifest[slot], total = 0, for item in manifest:, addition, and print(...).

List positions start at 0. An empty list has no first item; its sum stays at zero. This is a small bounded Python subset.

4
Collection state · inspected eventManifest items in order: slot 0 has 8; slot 1 has 3; slot 2 has 5; slot 3 has 2.

Manifest list

Starting values (read-only lesson input)

manifest = [8,3,5,2]

Positions start at index 0. Values are the parcel counts at those positions.

  1. Index 08
  2. Index 13
  3. Index 25
  4. Index 32

Border, ▶ marker and text identify the current read; color is an extra cue.

Help for this list puzzleHints build in steps. Worked help and solutions need a deliberate choice.

Highest help used on this case: none

For Further Reading and Exploration

These are outside sites with their own rules. You will see a notice before you leave. Pick one, not all.

  • Automate the Boring Stuff with Python

    Free book to read online. A chapter on lists covers indexes, slices and looping over a list.

    • Hands-on
    • May need an install
    • Ask an adult
  • CS50's Introduction to Programming with Python

    Free Harvard course with videos and notes. The loops lecture covers lists and looping over them.

    • Hands-on
    • Advanced
    • May count visits
  • MIT OpenCourseWare 6.100L

    Free college course notes and videos. It moves fast, so take one topic at a time. Look for the lectures on lists.

    • Hands-on
    • Advanced
    • May count visits
  • Raspberry Pi Foundation Projects

    Step-by-step Python projects. Pick one that keeps a list of things, then add an item. Some need hardware, so check the parts list.

    • Hands-on
    • May count visits