Lesson map
Lesson 05. Map, example, EX051.
flowchart TD
A["lab_leases.py compares two sets"] --> B["Seven rows, two UNKNOWN"]
C["lab_router.py evaluates seven flags"] --> D["Print: 2 of 7 pass"]
B --> E{"May one print answer the other question?"}
D --> E
E -->|No| F["Quote the script that measured it"]
The lease run is a set comparison. The router run is a list of flags.
Logical drawing
lease print
seven rows
unknown: ['bb:77', 'cc:19']
known but not seen: []
router print
PASS Wi-Fi uses WPA2 or WPA3
PASS guest network enabled
five FIX lines
2 of 7 pass
Learning outcomes
After this chapter, you should be able to:
- Name the question each script answers.
- Keep both prints.
- Refuse a note that treats one score as the other measurement.
5.1 Two instruments, taken on two different objects.
A measurement is only as good as the question it was built to answer. lab_leases.py holds a dictionary of five known hardware labels and a list of seven leases. It prints each lease, looks the label up, and then prints the set difference in both directions. The embedded run therefore ends with unknown: ['bb:77', 'cc:19'] and known but not seen: []. That is an inventory comparison. It does not read a password flag, a firmware age, or an isolation boolean.
lab_router.py holds a different object: a dictionary of settings. It evaluates seven predicates and prints PASS or FIX for each, then 2 of 7 pass. The two passing predicates are the Wi-Fi mode check and the guest-network check. The script never opens the lease list. A classmate who writes the unknown-device count into the router score, or who deletes the five FIX lines because the lease comparison "looked tidy," is reporting a quantity the second script did not compute.
Chapter 3 also separates practice from operations. The lease block is labelled synthetic, and the prose says Leo practises the comparison before a live export. The live export's rows are not in this file. The router block is likewise a synthetic settings dictionary. Chapter 4 later tells a story in which the checklist is considered again after changes. That story is not a second copy of lab_router.py. Leave both embedded runs as the only machine output the book contains.
5.2 Worked example
Match the sentence to the instrument that can support it.
Lesson table; scroll horizontally to read all columns →
| Cited line | Instrument | Decision |
|---|---|---|
unknown: ['bb:77', 'cc:19'] |
Lease comparison | Keep it on that print |
known but not seen: [] |
Lease comparison | Keep the empty side |
2 of 7 pass |
Router flags | Keep it on that print |
| "So the leases now pass 2 of 7." | Neither script | Refuse |
Synthetic case. Both prints belong to the Bramble Street exercise. Neither is a re-run of the other.
Errors and limits
A tidy inventory can sit beside a weak configuration. The two files are not drafts of one score.
Apply
- EX051 — Which instrument? The lease run lists seven rows and names two unknown labels. The router run says 2 of 7 pass. May the router score replace the lease print?
Show marking criteria
Rubric: 3 = no; both prints stay; the lease lines stay seven rows, unknown bb:77 and cc:19, and known-but-not-seen empty; the router print stays 2 of 7 with Wi-Fi and the guest network as the passes; do not edit either script;; 2 = the two prints stay different;; 1 = one print;; 0 = none.