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

## Chapter 5 — The scope print follows the request list

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

Lesson 05. Map, example, EX051.

```mermaid
flowchart TD
  R["requested, four strings, written order"] --> L["One pass, no sorted call"]
  L --> P["Four verdict lines in that same order"]
  P --> Q{"Did a score pick the first line?"}
  Q -->|No| K["Keep the embedded print"]
```

The scope script walks `requested`. It does not rank addresses.

### Logical drawing

```text
192.0.2.5      in scope
192.0.2.10     EXCLUDED - do not test
192.0.2.130    OUT OF SCOPE - do not test
198.51.100.7   OUT OF SCOPE - do not test
```
<!-- open-cyber-academy:lesson-figures:end ch-05 -->

### Learning outcomes

After this chapter, you should be able to:

1. Name the four strings in `requested`, in the order they are stored.
2. Say why `.10` prints second even though its verdict is a refusal.
3. Refuse a print that leads with the payroll address because it feels more important.

### 5.1 The loop emits `requested`. It does not call `sorted`.

`lab_scope.py` stores four strings. The first is `192.0.2.5`. The second is `192.0.2.10`. The third is `192.0.2.130`. The fourth is `198.51.100.7`. The `for` loop takes them in that stored sequence. Each pass builds one line and prints it before the next pass starts. Nothing in the file sorts those strings, and nothing reorders them after the verdict is chosen.

A refusal is still a line. The payroll address is second in the list, so its refusal is the second line. Putting the two `OUT OF SCOPE` lines first would be a different list. This file does not build that list.

| What chooses the row order | What does not |
|---|---|
| Position in `requested` | The verdict word |
| One forward pass | `sorted` |
| Print during the pass | A severity score |

### 5.2 Worked example

| Offered result | What produced it | Decision |
|---|---|---|
| `.5`, then `.10`, then `.130`, then `198.51.100.7` | The list, top to bottom | Keep |
| Payroll line second, and still a refusal | Position, not importance | Keep |
| "The script printed safe rows first." | No such reorder exists | Refuse |
| "Drop the refused lines so the page looks cleaner." | Those lines are the record | Refuse |

> **Synthetic case.** These four lines are the only scope-lab output.

### Errors and limits

Do not rebuild `requested` so a preferred verdict prints first.

### Apply

- **EX051 — List order.** The print names `.5`, then the payroll address, then `.130`, then `198.51.100.7`. May a preference for "in scope" rows, or a later note, replace that order? *Rubric:* 3 = no; the lines follow `requested`; a refusal still occupies its slot; do not sort the script;; 2 = the four lines stay and the note stays prose;; 1 = one line;; 0 = none.

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

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

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

## Worked answers

<a id="answer-ex051"></a>
**EX051.** No. The four lines follow `requested`. The payroll refusal stays in the second slot. A later note does not sort the script.
