Predict the command log, build a Python mission, then compare your plan with observations from a supervised flight. Keep grounded telemetry separate from measured travel.
Point or tap a waypoint. You can also focus the board and use the arrow keys. Trace the same ideas in the lessons.
Concept animation · no robot connection or measured results.
01Predict
Trace what your code will do.
02Build
Change one requirement.
03Observe
Separate commands from measurements.
04Explain
Show why the result makes sense.
Before the robot moves
Use laptop Python and the Tello Wi-Fi connection. Start with the no-network command log. Stock Tello is sufficient; these examples do not require EDU mission pads.
Start on paper or with a dry-run log. A tutor checks the actual robot and marked area before any physical movement. The code was checked in software; these materials do not claim a hardware flight or classroom test.
Laptop setup and data work
python3.12 -m venv .venv
# macOS / Linux
source .venv/bin/activate
# Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
S1 motion code runs in the app’s Lab environment. Data analysis runs on the laptop. Keep invented, simulated and measured data labelled separately.
01One distance, two robots: variables and units+
Convert a planned distance in metres into Tello centimetres and S1 metres, and explain why both commands represent the same target.
Start with a problem
Put two 30 cm tape marks on the floor. Show 30 and 0.30 on cards. Which value should each robot receive?
A named value lets us change the mission once. A unit conversion prevents the same number from requesting very different distances: Tello distance commands use centimetres; S1 distance commands use metres.
A bare number such as 30 hides its unit. Repeating that number in several commands makes a later route change easy to miss. A variable name documents the quantity, but a name alone does not convert it.
See the idea move
One distance, two units
Convert the unit before choosing the robot command.
01Plan
The target distance is 0.30 m.
02Convert
0.30 × 100 = 30 cm.
03Command
30 cm: the same planned distance.
Concept animation · no robot connection or measured results.
Read, predict, trace
Assignment stores a value under a name. Multiplying metres by 100 produces centimetres. int(round(...)) makes the whole-centimetre command explicit; the supplied distances have exact whole-centimetre targets.
variable: a name for a value
unit: what a number measures
conversion: express the same quantity in another unit
Predict the exact output before running it. Explain the result using variables, numbers, conversion and units.
duration_ms = 250
print(duration_ms / 1000)
250
0.25
250000
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-01-transfer-v1 · 2026-11-02.2
Build your version
Complete command_units(distance_m). Valid inputs are 0.20 to 0.80 metres, in whole centimetres. Return (Tello centimetres, S1 metres). This function only prepares values; it does not connect to a robot.
Explain this goal with a concrete input and state trace: Convert a planned distance in metres into Tello centimetres and S1 metres, and explain why both commands represent the same target.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
Run hardware/tello_missions.py units in dry-run first. Its 30 cm forward and 30 cm back commands use an integer distance. The live mode performs one supervised flight.
python hardware/tello_missions.py units
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Predict where each robot will finish. Measure the actual endpoint against the tape after it has stopped/landed. Record target and observed distance separately; equal requested distances do not promise equal accuracy.
Explain and transfer
Why would sending the unlabelled number 30 to both robots be a bad mission specification?
Convert a camera delay in milliseconds to seconds. Explain which unit belongs at the API boundary.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Treating a number as if it carries a unit automatically
Write m or cm beside every value. Multiplying by 100 changes the numerical value, not the physical distance.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
02Should this mission start? if, comparisons and booleans+
Implement and test a two-condition start rule, including values below, at and above the threshold.
Start with a problem
Show a mission with a clear lane but a low battery, then a charged robot with a blocked lane. Ask which one may start.
The same program needs different behaviour when its inputs change. Combining conditions makes the mission rule explicit and testable before motion.
Starting unconditionally ignores the inputs. Checking only one condition misses the other. A class battery threshold is a teaching policy, not a manufacturer guarantee.
See the idea move
Both checks must pass
An AND condition needs both inputs. These are classroom rules, not a safety certificate.
01First check
Battery ≥ 40% (classroom rule).
02Area check
A teacher confirms the marked area is clear.
03Both true
The classroom AND rule evaluates to True.
04One false
Keep the robot stopped; recheck the cause.
Concept animation · no robot connection or measured results.
Read, predict, trace
if chooses a branch. >= includes the boundary. A and B is True only when both are True. Use a 40% class preflight rule for Tello; classroom clearance still comes from the supervising person.
condition: a True/False test
boundary: the exact threshold
and: both tests must pass
battery = 40
clear = False
if battery >= 40 and clear:
print("go")
else:
print("stop")
Compare with the worked result
stop
Step
State
Result
battery >= 40
40 >= 40 is True
no output
True and clear
True and False is False
else selected
print in else
permission refused
stop
Practice before you run
These are formative practice prompts. A revealed or assisted answer stays practice; it is not a completed LMS lesson.
Before you begin
Predict the exact output before running it. Explain the result using if/else, >= and and.
print(40 > 40)
True
40
False
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-02-diagnosis-v1 · 2026-11-02.2
Try with a hint
Predict the exact output before running it. Explain the result using if/else, >= and and.
Predict the exact output before running it. Explain the result using if/else, >= and and.
print("enter" if 12 >= 12 and False else "wait")
enter
True
wait
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-02-transfer-v1 · 2026-11-02.2
Build your version
Write permit(battery, clear). Return "go" only for a battery of at least 40 AND a clear lane; otherwise return "stop". Inputs here are a numeric percentage and a boolean.
Explain this goal with a concrete input and state trace: Implement and test a two-condition start rule, including values below, at and above the threshold.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
The decisions demo stays grounded and reads the real battery. The class rule also needs --area-clear. Change the rule in a simulation, never drain a real battery to manufacture a boundary case.
python hardware/tello_missions.py decisions
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Use the four permission-table combinations in the simulation. On hardware, observe one normal reading and an S1 stop-marker response without making the lane unsafe. Record which inputs were measured and which were supplied by a person.
Explain and transfer
Why can the same code choose a different branch without being rewritten?
Design a library door rule using age and an adult permission flag. Include the exact age boundary.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Reading and as or, or excluding the equal boundary
Make a four-row True/False table. Test 39, 40 and 41 separately; a clear lane cannot repair a failed battery test.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
Trace range(4) and put both move and turn inside the repeated body.
Start with a problem
Show a four-leg square patrol. Ask students to change every leg from 30 to 40 cm, then to predict what an indented turn does.
One loop body describes a repeated patrol step. Changing the count or one parameter changes the repeated behaviour consistently.
Four copied blocks can work, but editing three and missing the fourth changes the route. A loop repeats only the indented body; a turn after the loop happens once.
See the idea move
Four legs, four turns
Each leg is 30 cm; each clockwise turn is 90°. A closed plan does not prove a closed real path.
01Leg 1
Move, then turn clockwise.
02Leg 2
Repeat the same two actions.
03Leg 3
Count the iteration, not just the turns.
04Leg 4
Finish the plan; measure any drift.
Concept animation · no robot connection or measured results.
Read, predict, trace
for visits each item in an iterable. range(4) provides 0, 1, 2, 3. Each iteration of a square patrol moves forward and turns 90 degrees; code after the loop runs once.
iteration: one pass through the body
range: integers with an excluded stop
indentation: which lines belong to the body
for leg in range(2):
print("move", leg)
print("turn")
print("done")
Compare with the worked result
move 0
turn
move 1
turn
done
Step
State
Result
leg = 0
first iteration
move 0, then turn
leg = 1
second iteration
move 1, then turn
range exhausted
leave loop
done
Practice before you run
These are formative practice prompts. A revealed or assisted answer stays practice; it is not a completed LMS lesson.
Before you begin
Predict the exact output before running it. Explain the result using for, range, indentation and repeated actions.
print(list(range(3)))
[0, 1, 2]
[1, 2, 3]
[0, 1, 2, 3]
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-03-diagnosis-v1 · 2026-11-02.2
Try with a hint
Predict the exact output before running it. Explain the result using for, range, indentation and repeated actions.
for leg in range(3):
print("move")
print("land")
move
land
move
land
move
land
move
move
move
land
move
move
land
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Hint
Draw one box around the indented body. Copy that whole box once for every integer in range.
Task robot-hooks-03-guided-v1 · 2026-11-02.2
Try independently
Predict the exact output before running it. Explain the result using for, range, indentation and repeated actions.
count = 0
for leg in range(4):
count = count + 2
print(count)
4
10
8
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Predict the exact output before running it. Explain the result using for, range, indentation and repeated actions.
for photo in range(2):
print("save")
print("close")
save
save
close
save
close
save
close
save
close
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-03-transfer-v1 · 2026-11-02.2
Build your version
Complete square_commands(sides). Return alternating "move" and "turn" strings, once per side. The function prepares a plan; the real square demo always uses four sides.
def square_commands(sides):
commands = []
# Repeat a move and a turn for each side.
return commands
print(square_commands(4))
Explain this goal with a concrete input and state trace: Trace range(4) and put both move and turn inside the repeated body.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
The square demo performs four 30 cm legs and four clockwise 90-degree turns, then lands. Predict the whole command log before supervised flight.
python hardware/tello_missions.py square
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Trace a paper square before running one physical square. Mark the predicted endpoint and heading; measure closure error after stopping. A correct loop cannot eliminate drift or wheel slip.
Explain and transfer
Which edit changes all four legs, and which indentation error would produce four moves but only one turn?
Plan five photograph-and-log actions, followed by one final upload. Explain why upload belongs outside the loop.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Counting the stop value or repeating a line outside the loop
Draw one box around the indented body. Copy that whole box once for every integer in range.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
04Wait for evidence: while loops and fresh readings+
Explain and implement both a success exit and an exhausted-budget exit, refreshing the input each pass.
Start with a problem
Hold back a marker, then reveal it at an unpredictable time. Ask how many checks the program should make.
The stopping point depends on incoming evidence rather than a fixed route length. A while condition expresses that dependency; a check budget prevents waiting forever.
A fixed for loop may keep checking after success. A while loop with an unchanged old reading cannot notice a new marker. The same behaviour can also be expressed with for and break; choose the form that makes the stop rule clearest.
See the idea move
A loop with an exit
Check for success and cap the number of attempts. A cached reading may be old.
01Read
Read height; classroom band: 60–160 cm.
02Test
Does this observation meet the condition?
03Success exit
Leave the loop as soon as the condition passes.
04Budget exit
If no reading passes within 6 checks, stop and report it.
Concept animation · no robot connection or measured results.
Read, predict, trace
while checks its condition before each pass. Update progress and read new evidence inside the body. Stop on success or when the maximum checks are used. A sleep spaces samples; it is not a new sensor reading.
poll: ask for a new reading
stale: a previously captured reading
budget: the maximum checks allowed
readings = [False, False, True]
checks = 0
found = False
while not found and checks < 3:
found = readings[checks]
checks += 1
print(checks, found)
Compare with the worked result
3 True
Step
State
Result
checks 0: read False
found False; checks becomes 1
no output
checks 1: read False
found False; checks becomes 2
no output
checks 2: read True
found True; checks becomes 3; exit
3 True
Practice before you run
These are formative practice prompts. A revealed or assisted answer stays practice; it is not a completed LMS lesson.
Before you begin
Predict the exact output before running it. Explain the result using while, state updates, break and bounded polling.
Predict the exact output before running it. Explain the result using while, state updates, break and bounded polling.
pages = ["busy", "ready", "ready"]
i = 0
while i < len(pages):
state = pages[i]
i += 1
if state == "ready":
break
print(i)
3
2
1
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-04-transfer-v1 · 2026-11-02.2
Build your version
Complete first_ready(readings, max_checks). Consume at most max_checks available booleans. Return (checks_used, found). Empty inputs and zero budget return (0, False). Recorded inputs simulate fresh polls; this is not an obstacle detector.
def first_ready(readings, max_checks):
checks = 0
found = False
# Update both variables from the next reading.
return checks, found
print(first_ready([False, True], 4))
Explain this goal with a concrete input and state trace: Explain and implement both a success exit and an exhausted-budget exit, refreshing the input each pass.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
The wait demo hovers and polls height at most six times, stopping once a reading is in the chosen 60-160 cm observation band, then lands. Height is a downward estimate, not forward clearance. These are new API queries to the latest state, not guaranteed distinct or timestamp-validated packets.
python hardware/tello_missions.py wait
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Try success on the first poll, delayed success and no success in a recorded stream. For S1, reveal the marker at different times. For Tello, compare the height log with the teacher observation without placing obstacles near the drone.
Explain and transfer
Why does repeating a condition on one old reading fail to detect a new event?
Monitor a print-job queue. Describe what is refreshed, what counts as success and what happens if the budget expires.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Testing a frozen reading or forgetting the budget update
Keep a table with check number, newly read value and next condition. Include a stream that never becomes ready.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
Edit an ordered route and append observations without losing earlier values.
Start with a problem
Give the robot a three-leg route, then swap the first and last distance cards without changing the movement code.
An ordered collection keeps route data separate from the code that executes each leg. A growing list also preserves multiple observations instead of overwriting one value.
Three separate variables require separate handling. Reassigning one variable loses the previous observation. A dictionary is better for named fields in one reading; a list is useful for the order of many readings.
See the idea move
A list keeps its order
Read the route from left to right. Reversing changes order, not the values.
01Index 0
20 cm
02Index 1
30 cm
03Index 2
40 cm
04Reverse
40 cm → 30 cm → 20 cm
Concept animation · no robot connection or measured results.
Read, predict, trace
A list preserves item order. Index 0 selects the first item and -1 selects the last. append adds one item at the end; iterating reads each route value in order.
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-05-transfer-v1 · 2026-11-02.2
Build your version
Return (number_of_legs, total_cm, final_leg_cm) from route_summary(route_cm). An empty route returns (0, 0, None). These are distances, not flight coordinates.
Explain this goal with a concrete input and state trace: Edit an ordered route and append observations without losing earlier values.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
The route demo iterates over [20, 30, 40] cm and then returns along the reversed route. Run dry first; the whole lane, not just the first leg, must be clear.
python hardware/tello_missions.py route
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Predict total outbound distance and the ordered command log. Change only the order, then only one leg. Explain which edit changes the endpoint and which changes only intermediate stops.
Explain and transfer
Why does append preserve more evidence than repeatedly assigning reading = new_value?
Store a playlist or a sequence of experiment readings and explain when order changes the meaning.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Starting indices at 1 or treating append as replacement
Number the boxes starting at 0. Draw the list again after append; it keeps the original boxes.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
06Name each measurement: dictionaries and records+
Build a record with meaningful keys, distinguish missing from zero and preserve successive records.
Start with a problem
Show [70, 80] and ask whether 70 is battery or height. Replace it with a labelled record.
Named fields keep unlike measurements distinguishable. A list of dictionaries represents many observations with the same named columns.
A positional list depends on everyone remembering the same field order. A dictionary gives fields names; it does not validate units or prove that a sensor actually measured the value.
See the idea move
A value needs a label
A dictionary separates the command, observation and source. A missing value is not zero.
01Robot
Tello
02Command
30 cm
03Missing
None: no observation was obtained.
04Zero
0: an actual recorded value of zero.
Concept animation · no robot connection or measured results.
Read, predict, trace
A dictionary maps a key to a value. Reusing the same key replaces its value. Separate reading dictionaries belong in a list when you need a time sequence. None marks a missing quantity; zero is a measured value.
Predict the exact output before running it. Explain the result using dictionaries, keys, values and lists of records.
weather = {"temp_c": 0, "rain_mm": None}
print(weather["temp_c"] is None)
False
True
0
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-06-transfer-v1 · 2026-11-02.2
Build your version
make_record(robot, sample, battery_pct, height_cm) returns a new dictionary with exactly those four keys. Missing measurements stay None. Call it twice and show that the dictionaries are separate objects.
a = make_record("tello", 1, 80, 90)
b = make_record("s1", 2, None, None)
assert a == {"robot": "tello", "sample": 1, "battery_pct": 80, "height_cm": 90}
assert b["height_cm"] is None
assert a is not b
assert set(b) == {"robot", "sample", "battery_pct", "height_cm"}
Explain this goal with a concrete input and state trace: Build a record with meaningful keys, distinguish missing from zero and preserve successive records.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
The records demo stays grounded and makes dictionaries from actual battery and height state values. Ground height is not airborne performance.
python hardware/tello_missions.py records
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Write one schema before collecting anything. Capture at least two observations. For each key, identify whether it came from a sensor, a person or a derived calculation; leave unavailable quantities blank.
Explain and transfer
Why does putting height_cm in a key help readers, and what does that key still fail to guarantee?
Design a weather record with one true zero and one missing value, and explain the difference.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Using a positional index as a key or replacing history with one updated record
Write the schema as key: meaning (unit). Check whether a change updates one record or adds a new observation.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
07Teach a reusable move: functions, parameters and methods+
Separate a pure conversion function from an action method, and explain what each call returns or changes.
Start with a problem
Ask for a short patrol, then a longer one. Should the student copy the whole program or give the same move a different input?
A function gives a meaningful name to reusable behaviour. Parameters vary the input. Return values let calculations be tested before a hardware method performs an action.
Copying movement code creates multiple places to fix. Printing a converted distance does not return it to another function. tello.move_forward(...) is a method on a particular device object; a plain conversion function needs no device.
See the idea move
Input → function → result
A pure conversion function returns a value. A device method is a separate action.
01Argument
Pass 0.30 m into the conversion function.
02Return
The function returns 30 cm.
03Device action
Use the reviewed value in the device-specific command.
Concept animation · no robot connection or measured results.
Read, predict, trace
def defines a function; calling it runs its body. return sends a value to the caller. A method is accessed through an object, as in samples.append(value) or drone.move_forward(cm). These are both calls, but their owners and effects differ.
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-07-transfer-v1 · 2026-11-02.2
Build your version
out_and_back(distance_m) returns [("forward", cm), ("back", cm)]. The parameter is 0.20-0.80 m in whole centimetres. Use a conversion function; do not import a robot library or send motion.
Explain this goal with a concrete input and state trace: Separate a pure conversion function from an action method, and explain what each call returns or changes.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
The functions demo calls an out_and_back helper, which calls the device methods move_forward and move_back. Underline the argument at each layer.
python hardware/tello_missions.py functions
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Test the conversion and returned plan without a robot. On hardware run the unchanged helper with 0.20 and 0.30 m targets. Explain how one function serves two requests.
Explain and transfer
How is calling to_cm(0.3) different from calling drone.move_forward(30)?
Write a reusable photo filename function; keep generating the name separate from saving a file.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Assuming definition runs the body or print supplies a return value
Mark definition, call, return and side effect separately. A returned number is not a movement command.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
Enumerate each grid cell exactly once and distinguish logical coordinates from physical travel.
Start with a problem
Lay out a 2 by 3 paper inspection grid. Students predict whether two loops produce five or six inspections.
Two dimensions require visiting every row/column combination. An inner loop handles columns for each row selected by the outer loop.
Adding row and column counts does not enumerate their combinations. A logical grid coordinate is not automatically a flight or wheel command; a route planner must define the geometry.
See the idea move
Two loops, four stops
This 2 × 2 serpentine route uses 30 cm steps. Visiting a logical cell does not prove camera coverage.
01Row 0 · Col 0
Start at the first cell.
02Row 0 · Col 1
Cross the first row.
03Row 1 · Col 1
Change rows at the edge.
04Row 1 · Col 0
Traverse the next row in reverse.
Concept animation · no robot connection or measured results.
Read, predict, trace
For each outer row, the inner column loop starts again. A 2-row, 3-column grid has 2 * 3 cells. A physical scan can traverse alternate rows in opposite directions to avoid extra return trips.
outer loop: chooses one row
inner loop: visits columns in that row
coordinate: a row/column pair
for row in range(2):
for col in range(2):
print(row, col)
Compare with the worked result
0 0
0 1
1 0
1 1
Step
State
Result
row = 0
col visits 0 then 1
0 0; 0 1
row = 1
col restarts at 0 then 1
1 0; 1 1
Practice before you run
These are formative practice prompts. A revealed or assisted answer stays practice; it is not a completed LMS lesson.
Before you begin
Predict the exact output before running it. Explain the result using nested for loops and row/column coordinates.
print(2 * 3)
5
23
6
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-08-diagnosis-v1 · 2026-11-02.2
Try with a hint
Predict the exact output before running it. Explain the result using nested for loops and row/column coordinates.
n = 0
for row in range(2):
for col in range(3):
n += 1
print(n)
6
5
3
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Hint
Write the row once, then list all columns next to it. Repeat for the next row.
Task robot-hooks-08-guided-v1 · 2026-11-02.2
Try independently
Predict the exact output before running it. Explain the result using nested for loops and row/column coordinates.
for row in range(1):
for col in range(3):
print(row, col)
0 0
1 1
2 2
0 0
0 1
0 2
1 1
1 2
1 3
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Predict the exact output before running it. Explain the result using nested for loops and row/column coordinates.
for day in range(2):
for sensor in ["A", "B"]:
print(day, sensor)
0 A
1 B
A 0
B 1
0 A
0 B
1 A
1 B
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-08-transfer-v1 · 2026-11-02.2
Build your version
grid_cells(rows, cols) returns row-major (row, col) pairs. Valid inputs are nonnegative integers. Test zero rows and zero columns. The result is a checklist; it must not move a robot.
Explain this goal with a concrete input and state trace: Enumerate each grid cell exactly once and distinguish logical coordinates from physical travel.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
The grid demo traverses a 2 by 2 serpentine plan with 30 cm spacing, printing each logical cell. Its bounded demonstration does not claim camera coverage, autonomous localization or obstacle avoidance.
python hardware/tello_missions.py grid
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Mark each paper cell as the dry-run log visits it. Check uniqueness and count. Then mark physical positions after one supervised pass; distinguish visiting a label from verifying an actual image footprint.
Explain and transfer
Why is the number of inspections rows times columns, and why are grid labels insufficient to command a physical robot?
Schedule each sensor on each day; explain which loop restarts and how many readings are planned.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Adding loop counts or failing to restart the inner loop
Write the row once, then list all columns next to it. Repeat for the next row.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
09Keep the evidence: files, CSV and data provenance+
Save and reload trial records with field names, units, origin and unsuccessful outcomes.
Start with a problem
Close a program that only printed its results. Ask what evidence the next class can inspect.
A saved table survives program exit and can be reopened by another tool. A stable schema and provenance label make the measurements interpretable.
A list in memory disappears when the process ends. Copying only successful trials creates a biased record. The S1 Lab cannot write a laptop CSV, so the observer records physical trials through the supplied laptop tool.
See the idea move
From a trial to a CSV row
Keep interrupted trials and label invented, simulated and measured data separately.
01Plan
Record target, robot and condition.
02Observe
Measure travel independently of the command log.
03Save
Store source, outcome and any missing values.
04Audit
Retain the raw row, including aborted trials.
Concept animation · no robot connection or measured results.
Read, predict, trace
CSV stores one record per row and named columns in a header. DictWriter uses a field list to align values. CSV text is not typed data: numeric strings need conversion when read back.
schema: expected columns and meanings
provenance: where a value came from
CSV: comma-separated tabular text
import csv
from io import StringIO
text = "robot,target_cm\ntello,30\ns1,30\n"
rows = list(csv.DictReader(StringIO(text)))
print(len(rows), rows[0]["target_cm"])
Compare with the worked result
2 30
Step
State
Result
CSV header
robot and target_cm become keys
no output
DictReader
two dictionaries; values are strings
no output
len and first target
2 records; text value "30"
2 30
Practice before you run
These are formative practice prompts. A revealed or assisted answer stays practice; it is not a completed LMS lesson.
Before you begin
Predict the exact output before running it. Explain the result using file I/O, CSV, rows, schemas and provenance.
import csv
from io import StringIO
r = list(csv.DictReader(StringIO("x\n3\n4\n")))
print(len(r))
2
3
1
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-09-diagnosis-v1 · 2026-11-02.2
Try with a hint
Predict the exact output before running it. Explain the result using file I/O, CSV, rows, schemas and provenance.
import csv
from io import StringIO
r = next(csv.DictReader(StringIO("cm\n30\n")))
print(type(r["cm"]).__name__)
int
str
float
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Hint
Separate the header from data rows. DictReader values are strings; cast them before arithmetic.
Task robot-hooks-09-guided-v1 · 2026-11-02.2
Try independently
Predict the exact output before running it. Explain the result using file I/O, CSV, rows, schemas and provenance.
import csv
from io import StringIO
r = list(csv.DictReader(StringIO("cm\n20\n35\n")))
print(sum(int(x["cm"]) for x in r))
2035
2
55
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Predict the exact output before running it. Explain the result using file I/O, CSV, rows, schemas and provenance.
import csv
from io import StringIO
r = list(csv.DictReader(StringIO("day,rain_mm\nMon,0\nTue,2\n")))
print(r[0]["rain_mm"])
0
2
None
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-09-transfer-v1 · 2026-11-02.2
Build your version
Read CSV text with header target_cm and return the numeric targets in order. Inputs contain valid integer strings. Then use record_trial.py to save a complete or aborted physical trial with origin=measured; do not edit the synthetic fixture to masquerade as measurements.
Explain this goal with a concrete input and state trace: Save and reload trial records with field names, units, origin and unsuccessful outcomes.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
The telemetry demo writes actual grounded state records to an explicitly chosen --log path. For movement experiments the observer uses record_trial.py to record independent tape measurements.
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Collect one short-travel trial for each available robot. Use the same target and record the robot, condition, pair number, order, method, outcome and target even if the run is aborted. Compare terminal output with the reopened CSV.
Explain and transfer
Why does a saved row need both an outcome and a measurement method?
Log a weather observation with origin and units so another student can read it a week later.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Counting the header as a trial or assuming CSV has numeric types
Separate the header from data rows. DictReader values are strings; cast them before arithmetic.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
Show an empty distance measurement and the number 0. Ask whether filling every blank with zero would improve the robot.
A machine-readable file can still contain unusable or missing values. Explicit conversion and reason flags keep cleaning decisions visible and prevent invented measurements.
Replacing missing distances with zero manufactures a huge error. Deleting all failures makes the robot appear better. Preserve the raw file and write a separate audit of every row.
See the idea move
Missing, invalid, or measured?
Keep the raw data and record each cleaning decision. Never replace every missing value with zero.
01Measured zero
0 → retain when it is a valid observation.
02Missing
Blank → mark missing; investigate the source.
03Invalid
Text in a distance field → flag for review.
04Audit trail
Keep the raw row and the reason for each change.
Concept animation · no robot connection or measured results.
Read, predict, trace
pd.to_numeric(errors="coerce") turns invalid numeric text into missing data. isna detects it. A boolean mask selects eligible records; the excluded rows and their reasons must remain inspectable.
DataFrame: a table with named columns
mask: one True/False choice per row
coerce: convert invalid numeric text to missing
import pandas as pd
s = pd.to_numeric(pd.Series(["30", "bad", "0"]), errors="coerce")
print(int(s.isna().sum()), int(s.dropna().sum()))
Compare with the worked result
1 30
Step
State
Result
convert numeric text
30.0, missing, 0.0
no output
isna().sum()
one unknown measurement
first result is 1
sum observed values with dropna
30 + 0; missing value stays unknown in the original series
1 30
Practice before you run
These are formative practice prompts. A revealed or assisted answer stays practice; it is not a completed LMS lesson.
Before you begin
Predict the exact output before running it. Explain the result using DataFrame, numeric conversion, masks and missing values.
import pandas as pd
print(pd.isna(None))
False
True
0
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-10-diagnosis-v1 · 2026-11-02.2
Try with a hint
Predict the exact output before running it. Explain the result using DataFrame, numeric conversion, masks and missing values.
import pandas as pd
s = pd.to_numeric(pd.Series(["20", "oops", "40"]), errors="coerce")
print(int(s.notna().sum()))
3
1
2
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Hint
Track measured zero, blank and invalid text separately. A numeric conversion failure is a reason to flag, not a reason to silently invent a value.
Task robot-hooks-10-guided-v1 · 2026-11-02.2
Try independently
Predict the exact output before running it. Explain the result using DataFrame, numeric conversion, masks and missing values.
import pandas as pd
s = pd.Series([0.0, None, 30.0])
print(int(s.isna().sum()), int((s == 0).sum()))
1 1
2 0
0 2
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Predict the exact output before running it. Explain the result using DataFrame, numeric conversion, masks and missing values.
import pandas as pd
s = pd.to_numeric(pd.Series(["0", "", "2"]), errors="coerce")
print(int(s.notna().sum()))
3
2
1
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-10-transfer-v1 · 2026-11-02.2
Build your version
clean_distances(values) converts strings with pandas, drops missing or negative values, and returns the remaining numeric values in input order. This tiny exercise does not remove rows from the trial audit. In the full experiment, outcome counts retain every trial.
Explain this goal with a concrete input and state trace: Convert numeric text, identify missing/impossible values and preserve unsuccessful trial counts.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
Use saved Tello records or the explicitly synthetic fixture; keep grounded telemetry separate from independently measured travel trials.
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Run analyze_trials.py on data/synthetic_trials.csv. Inspect row_audit.csv alongside the raw rows. Explain why the malformed, missing, aborted and origin-mismatched rows have different flags.
Explain and transfer
Why can keeping a measured zero and excluding a missing value both be correct?
Clean a rainfall column without turning an unobserved day into a dry day.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Equating missing with zero or erasing aborted trials
Track measured zero, blank and invalid text separately. A numeric conversion failure is a reason to flag, not a reason to silently invent a value.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
11Which setting works better? grouping, charts and fair trials+
Compare repeated, paired settings within one robot using counts, absolute error, spread and outcome rate without claiming more than the sample supports.
Start with a problem
Show two settings with the same average error but different spreads. Ask which evidence is missing from a single average.
Grouping compares like trials while counts and spread reveal how much evidence supports a summary. A graph with individual points exposes variation hidden by a mean.
One impressive run is weak evidence. Pooling robots hides different mechanics. Comparing slow runs on one surface with fast runs on another confounds speed with surface.
See the idea move
Opposite errors can cancel
Illustrative errors in cm. Compare robot × condition with counts, outcome rates and spread.
01Trial A
+4 cm: farther than the target.
02Trial B
−4 cm: shorter than the target.
03Signed mean
(+4 − 4) ÷ 2 = 0 cm.
04Mean absolute error
(|+4| + |−4|) ÷ 2 = 4 cm.
Concept animation · no robot connection or measured results.
Read, predict, trace
Signed error is measured minus target; absolute error measures miss size. Group by robot and condition. Count all trial outcomes, then calculate distance statistics only for complete valid measurements. Plot every valid point and report how many trials were excluded.
Predict the exact output before running it. Explain the result using groupby, aggregates, variability and controlled comparison.
waits = [1, 1, 7]
print(max(waits) - min(waits))
3
7
6
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-11-transfer-v1 · 2026-11-02.2
Build your version
error_summary(target_cm, observed_cm) returns count, mean signed error, mean absolute error and range of signed errors. The observations are complete, valid numbers. An empty list returns count 0 and None for the three statistics. Then inspect the full grouped CSV and plot from analyze_trials.py.
Explain this goal with a concrete input and state trace: Compare repeated, paired settings within one robot using counts, absolute error, spread and outcome rate without claiming more than the sample supports.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
Use the trial demo at --speed 20 for slow and --speed 30 for fast, with the same 30 cm target. Each run lands before the observer measures. Compare Tello only with its own trials.
python hardware/tello_missions.py trial
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Plan at least three slow/fast pairs per robot. Alternate order slow-fast, fast-slow, slow-fast (or randomize and record order). Record aborted runs too. Keep target 30 cm, surface, battery band, measurement ruler and start position fixed; note battery drift and order as remaining limitations. This is exploratory classroom evidence, not a population-level speed claim.
Explain and transfer
Why must a report show trial counts and unsuccessful runs alongside mean error?
Compare two queue policies with repeated waits, documenting the workload and order rather than showing only the best wait.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Treating cancellation as accuracy or ignoring failed/omitted trials
Do not average signed misses before taking absolute values: +4 and -4 cancel. Write the denominator of every rate.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
Choose and justify each structure, demonstrate bounded behaviour and present reproducible evidence with limitations.
Start with a problem
Give a client request: inspect four marked stations and explain whether a revised setting improved reliability. Students choose the code structures before seeing a solution.
Real tasks combine planning, execution and evidence. Each structure should solve a named problem: lists order stations, dictionaries label readings, loops repeat or wait, and functions isolate reusable decisions.
A moving robot is not proof that every station was inspected. A passing public test is not proof of reasoning or physical reliability. A graph of synthetic data is not a hardware result.
See the idea move
Review the whole route first
Execution follows a reviewed plan. An animation or command receipt is not measured completion.
01Plan
Describe the route and its limits.
02Validate
Check every route element before any motion.
03Execute
Use only the reviewed commands and limits.
04Record
Keep the result, including interruption.
05Explain
Compare the plan with independent observations.
Concept animation · no robot connection or measured results.
Read, predict, trace
Separate mission data from control logic and recorded evidence. Validate the complete route before executing any leg. Test a normal case, an empty route and a refused value. Use a fixed patrol for known stations and a bounded wait only when completion depends on evidence.
requirement: an observable success condition
integration: parts working together
reproducibility: another person can rerun the analysis
route_cm = [20, 30]
records = []
for station, distance_cm in enumerate(route_cm):
records.append({"station": station, "target_cm": distance_cm})
print(len(records), records[1]["target_cm"])
Compare with the worked result
2 30
Step
State
Result
station 0, distance 20
append one labelled record
no output
station 1, distance 30
append second record
no output
inspect evidence
2 records; second target 30
2 30
Practice before you run
These are formative practice prompts. A revealed or assisted answer stays practice; it is not a completed LMS lesson.
Before you begin
Predict the exact output before running it. Explain the result using choosing structures, testing, integration and evidence.
route = [20, 30, 40]
print(len(route))
3
90
2
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-12-diagnosis-v1 · 2026-11-02.2
Try with a hint
Predict the exact output before running it. Explain the result using choosing structures, testing, integration and evidence.
rows = []
for station in range(2):
rows.append({"station": station})
print(rows[-1]["station"])
2
1
0
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Hint
Map each requirement to a data field, control rule and observable check. Do not start movement before the whole plan passes validation.
Task robot-hooks-12-guided-v1 · 2026-11-02.2
Try independently
Predict the exact output before running it. Explain the result using choosing structures, testing, integration and evidence.
route = [20, 0, 30]
print(all(20 <= x <= 80 for x in route))
True
0
False
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Predict the exact output before running it. Explain the result using choosing structures, testing, integration and evidence.
queue = ["A", "B"]
receipts = []
for job in queue:
receipts.append({"job": job, "done": False})
print(receipts[1]["done"])
False
True
B
Write your prediction, confidence and reasoning before running the code. Record any help you used.
Task robot-hooks-12-transfer-v1 · 2026-11-02.2
Build your version
mission_plan(route_cm) validates the entire route before building any records. Accept only exact int values 20-80 cm (not booleans), at most four legs and at most 200 cm total; otherwise raise ValueError. Return one {station, target_cm} dictionary per leg. Then demonstrate a reviewed fixed-route program using the supplied robot runner, record every trial and write a claim supported by its evidence.
Explain this goal with a concrete input and state trace: Choose and justify each structure, demonstrate bounded behaviour and present reproducible evidence with limitations.
Modify the starter, pass the public tests, and add one meaningful new case with predicted and observed results.
Present a labelled artifact from the robot experiment or a declared simulation, with a limitation and an independent changed-context explanation.
Tello LAB
Observe the robot
Start with the route or square demo and its dry-run log. Keep any live edit inside the reviewed class limits; use a bounded hover check only if the mission needs it. A print saying station visited is a command receipt, not independent inspection evidence.
python hardware/tello_missions.py route
Without --live, the mission command only prints a command log; it does not connect to a drone.
Change one thing and measure
Submit a route plan and concept-to-requirement table, predicted log, tested code, raw trial CSV with origin, cleaning audit, grouped chart and a 90-second explanation. Include an unsuccessful case and a changed-context task. If hardware is unavailable, mark the whole demonstration simulated and leave physical reliability undecided.
Explain and transfer
Choose one loop, one collection and one function. Explain the requirement each solves, an alternative, and a case where you would choose differently.
Apply the plan-execute-record separation to a photo-processing queue. State which claims transfer and which require new evidence.
Save your code, prediction, actual result and one limitation. Label a command-log demonstration as simulated. Ask your tutor for a fresh review around day 2 and day 7, adjusted to your needs.
If your result is unexpected
Confusing command completion with measured mission success
Map each requirement to a data field, control rule and observable check. Do not start movement before the whole plan passes validation.
After a correction, explain the changed state and try the unopened independent variant. If it was exposed, use a tutor-authored changed-input task and give it a new ID; keep the original record.
This workbook uses CIT’s existing Python and data-science topics, with separate Tello activities. Learning content revision: 2026-11-02.2. Choose EN or KO for every lesson.
For a fresh independent variant or a later review, ask your tutor. This page does not award a score, mark an LMS lesson complete, or schedule a review.