<a id="ch-08"></a>

## Chapter 8 — The independent line is a list repr

<!-- open-cyber-academy:lesson-figures:start ch-08 -->
### Lesson map

Lesson 08. Map, example, EX054.

```mermaid
flowchart TD
  S["Four tuples"] --> E{"Is needs empty?"}
  E -->|Yes| L["One name in a Python list"]
  E -->|No| D["A deps key instead"]
  L --> P["Brackets and single quotes"]
```

Empty needs select the name. The print then shows Python's list form.

### Logical drawing

```text
kept
  National charity advisories
printed form
  ['National charity advisories']
excluded
  any tuple whose needs list is non-empty
not shown
  the word web page
```
<!-- open-cyber-academy:lesson-figures:end ch-08 -->

### Learning outcomes

After this chapter, you should be able to:

1. State the test `if not needs`.
2. Read the brackets and quotes as Python's list form.
3. Refuse a channel word the line does not contain.

### 8.1 Empty means independent. The brackets are part of the print.

The last statement builds a list of names whose needs list is empty. `if not needs` is true for `[]` and false for a list that holds a string. Only National charity advisories has an empty needs list, so the result has one element. `print` of a list uses Python's representation: square brackets, a single-quoted string, and no extra label invented by Sam. The line begins with the words `independent sources:` because that literal is in the format string. The brackets are not a TLP mark.

The channel `web page` is the second field of the tuple. The comprehension keeps `n` and drops the channel. A reader cannot recover `web page` from the independent line. The other three sources are absent here because each has a needs list, not because the script judged them unimportant. Fixing the inbox in prose does not move Donation platform notices onto this line. The embedded list still has one name.

| Piece | What it contributes |
|---|---|
| `if not needs` | Selects an empty needs list |
| List representation | Brackets and single quotes |
| The channel field | Stored, not printed on this line |
| A later shared mailbox | Does not edit the list |

### 8.2 Worked example

| Offered reading | What the line shows | Decision |
|---|---|---|
| One name, inside brackets and quotes | The list representation | Keep |
| The other three sources are absent | Their needs lists are non-empty | Keep |
| "The line says web page." | The channel was not kept | Refuse |
| "A shared mailbox removes the brackets." | The print is unchanged | Refuse |

> **Synthetic case.** One independent name is the whole list.

### Errors and limits

Do not treat the brackets as a sharing label.

### Apply

- **EX054 — List form.** What does `['National charity advisories']` include, and why are the email sources absent from it? *Rubric:* 3 = one name in Python's list form; email sources have a non-empty needs list; the channel word is not on the line; a later mailbox fix does not edit the print;; 2 = the brackets hold one empty-needs name;; 1 = the name only;; 0 = none.

<!-- open-cyber-academy:chapter-navigation:start ch-08 -->
### Continue studying — lesson 08 (chapter 08 of 20)

[← Chapter 07](#ch-07) · [Course chapter index](../SUBJECTS.md) · [Chapter 09 →](#ch-09)

Continue to the next authored lesson.
<!-- open-cyber-academy:chapter-navigation:end -->

## Worked answers

<a id="answer-ex054"></a>
**EX054.** The brackets hold one name, National charity advisories, because its needs list is empty. Email sources have a non-empty needs list. The channel word is not on the line, and a later mailbox fix does not edit the print.
