Separate practice answers

Make your prediction in the studio before reading these explanations.

PROGRAM CONSTRUCTION STUDIO — SEPARATE ANSWERS

1. ORDER
The working order is title -> clean -> decide -> display.
Before clean runs, clean_title does not exist. Before decide runs, result does
not exist. Moving display before decide produces:
NameError: name 'result' is not defined
The error stops this run; later instructions are not executed.
For the practice order title, decide, clean, display, the decision stops with:
NameError: name 'clean_title' is not defined
The title name exists, but that is not the name this comparison reads.

2. LOOP PLACEMENT
With the original blank second title and print outside:
Missing titles: 1
With print inside:
Missing titles: 0
Missing titles: 1
The first line is printed after index.html, before untitled.html is checked.
It is not the final report. With the second title changed to Contact and print
inside, the two lines are both Missing titles: 0. A page that passes still runs
the rest of that loop pass; print is not inside the if condition.

3. FUNCTION
At return, nothing has been printed. The text goes back to the caller, which
stores it as verdict. The last print displays that value.
For input Meeting Rooms:
local clean_title: "Meeting Rooms"
return value: "OK: title present"
final output: OK: title present
The local name clean_title belongs to the function call; the caller stores the
returned text under a different name, verdict.

4. EVENT
Choosing Social does not submit the form. This handler is registered for the
submit event, so the selection alone leaves No report yet. on the page.
When the form is submitted, Social selects Social Launch and Social Retargeting,
then displays Campaigns selected: 2. Email selects Newsletter only and displays
Campaigns selected: 1. The visible label reports the length of the selected
array. It does not count all five source records.

Back to the construction studio