Lesson map
Lesson 15. Map, example, EX061.
flowchart TD
K["Keys whose Boolean is false"] --> J["Join those keys with comma-space"]
J --> E{"Is that list empty?"}
E -->|No| N["Print NOT READY and the keys"]
E -->|Yes| R["Print READY"]
This run takes the first branch. The ready word is the other branch.
Logical drawing
false keys, in dictionary order: admin accounts use MFA
printed line: NOT READY: admin accounts use MFA
READY: not printed
Learning outcomes
After this chapter, you should be able to:
- Build
missingas the false keys. - Read the printed line as that join.
- Refuse a count of people inside the Boolean.
15.1 One false key. The prose about three accounts is not the value.
missing keeps every key whose Boolean is false, in dictionary order. ', '.join(missing) would separate several keys with a comma and a space. This dictionary has one false key, so the join has nothing to separate. The printed line is exactly NOT READY: admin accounts use MFA. READY prints only when missing is empty. It is not empty.
The opening week speaks of three administrator accounts. The release lesson says one volunteer administrator has not finished multi-factor sign-in. Those sentences are prose. The Boolean does not store the integer 3, the integer 1, or a fraction. It does not store the volunteer's name, which was never given, or the kind of second factor. Two finished accounts and one unfinished account would be a story about the prose. It is not a value the script computed, and this chapter does not print 2 of 3.
If a second key were false, its name would appear in missing in dictionary order, on the same NOT READY line. No second key is false. Changing the MFA Boolean to true in order to see READY would be a different file. The published checklist does not make that change.
Lesson table; scroll horizontally to read all columns →
| Stored by the false Boolean | Not stored |
|---|---|
| The key is unmet | Which of three accounts |
| It is the only unmet key | A name, a factor type, a serial |
| The line names that key | The word READY |
15.2 Worked example
Lesson table; scroll horizontally to read all columns →
| Reading | What missing holds |
Decision |
|---|---|---|
| NOT READY names one key | admin accounts use MFA |
Keep |
| READY is the empty-list branch | The list has one key | Keep as the other branch |
| "The script reports 2 of 3 accounts." | No account count is stored | Refuse |
| "Two unmet keys were joined." | One Boolean is false | Refuse |
Synthetic case. The volunteer administrator remains unnamed.
Errors and limits
Do not turn one Boolean into a census of the three accounts.
Apply
- EX061 — The false key. The last line says
NOT READY: admin accounts use MFA. A classmate rewrites it as2 of 3and adds the unfinished volunteer's name. What does the line actually contain?Show marking criteria
Rubric: 3 = one false key, named in full, afterNOT READY:;READYis not printed; three accounts and one unfinished volunteer stay prose; no name and no2 of 3are in the script;; 2 = the printed line stays and the census stays out;; 1 = one token;; 0 = none.