OpenCyber Academy
Rapid course · Lesson 6 · English
Course code: OCA-003Lesson 06: OCA-003-A006

One removed duplicate is not a new census

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

Lesson map

Lesson 06 published. Map, example, EX060.

flowchart TD
  L["Published run: rows 12; five with a yes tick"] --> N["Notebook: one duplicate email removed"]
  N --> R{"Has a new typed list been checked?"}
  R -->|No| K["Do not print 11 or 4 as this month's result"]
  R -->|Yes| C["Record that run's own lines"]

A notebook finding is not a second execution of the script.

Logical drawing

lab_signups.py on the twelve-row synthetic file
    rows 12; blank email 2; malformed 1; duplicates 2
    unique valid addresses with a yes tick: 5
first-month notebook
    one duplicate email removed
        |
        +-- the removal is a finding, not a rerun
        +-- 12 minus 1 is arithmetic, not a measurement
        +-- the script is not edited to force a new print

Learning outcomes

After this chapter, you should be able to:

  1. Keep the published twelve-row output as the only verified count of that file.
  2. Reject 11 rows, or 4 sendable addresses, when nobody has rerun the check.
  3. Leave the program and its printed lines unchanged.

6.1 The notebook and the script answer different questions

The first month's notebook says one duplicate email was removed. That sentence records a check. The script's print describes the synthetic file of twelve rows, before anyone subtracts. A classmate writes "open send list this month: 4" because one duplicate left the café. The five were unique addresses with an exact yes tick. Removing a duplicate does not, by itself, remove one of those five, and it does not shrink the twelve-row file. Either effect would have to be counted on a new export. Kwame does not type 4 or 11 into the notebook as if the program had printed them.

6.2 Worked example

Lesson table; scroll horizontally to read all columns →

Claim What was actually done Decision
"One duplicate was taken off the working list." The notebook says so Keep it as a finding
"So the file is now 11 rows." No new run Refuse the number
"So only four people may be emailed." The five were already unique Refuse. Uniqueness was already in the print
"Edit the ticks so the next print looks tidier." The script counts the file it is given Refuse the edit

Synthetic case. The lines rows 12 and unique valid addresses with a yes tick: 5 stay the published run.

Errors and limits

A later month might show different counts. Those counts exist only after that month's list is checked. This chapter does not perform that check.

Apply

Worked answers

EX060. Neither 11 nor 4 was counted. The verified print remains 12 rows and 5 yes-tick addresses. Do not edit the script.