Programming Explainers That Ship With a Passing Test
Two Golpo programming videos tied to tests you can rerun: Python’s round on ties, and sum(range(1, 10)), which is 45.

The short answer: This page is two programming videos whose spoken results match a test. The first is Python’s round on a tie: round(0.5) is 0, round(−0.5) is 0, and round(1.5) is 2. The second is range: sum(range(1, 10)) is 45, because the stop value 10 is excluded. The sum of 1 through 10 is 55, which is sum(range(1, 11)).
Rerun both on the Python version your course actually uses, and keep that version with the lesson. Golpo does not run the tests. You do, and then the script quotes the output.
1. Round half to even
Python’s built-in round uses bankers’ rounding when two integers are equally close: it chooses the even one. On current CPython 3, round(0.5) is 0, round(−0.5) is 0, and round(1.5) is 2. The test file should assert those three values and print them.
Ties go to even · Script Mode · open MP4
What we sent to Golpo
Script Mode speaks the script below word for word. The other fields do different jobs.
Settings
Own Narration: OFF · Script Mode: ON · Duration: 1 minute · Orientation: Horizontal (16:9) · Style: Professional Clean · Color: ON · Language: English · Voice: Male 1 · Pace: Normal · Music: None
Script
This is the narration.
Python rounds a tie to the nearest even integer. The course pins an interpreter and runs three calls before this lesson is recorded. round of zero point five returns zero. round of negative zero point five returns zero. round of one point five returns two. Zero is even, so both ties at one half land on zero. One point five sits halfway between one and two, and two is the even neighbor, so the result is two. The spoken results are the results the test just printed. The unit test lives in the course repository. This lesson is recorded only after that test passes. A script that says one for a half tie does not get a picture. Show all three calls, and show zero, zero, and two. Zero, zero, and two have to match the printout from the pinned interpreter. The picture may not invent another call.
Video Instructions
Video Instructions tell Golpo what to draw. They are not spoken.
Three Python calls on a pinned interpreter. Zero point five and negative zero point five round to zero. One point five rounds to two. End on those three results. Do not add a fourth call. On-screen labels: round(0.5) = 0; round(-0.5) = 0; round(1.5) = 2; Ties to even.
Voice Instructions
Voice Instructions set how the narrator sounds. They are separate from the script.
Exact about Python rounding. Read each call, then its result.
2. The stop value is excluded
range(1, 10) yields 1 through 9. The sum is 45, which is also 9 × 10 / 2. The sum of 1 through 10 is 55, and that is sum(range(1, 11)). An assertion that sum(range(1, 10)) equals 55 fails. The video shows that failed expectation and then the call that returns 55.
The stop that is not included · Script Mode · open MP4
What we sent to Golpo
Settings
Own Narration: OFF · Script Mode: ON · Duration: 1 minute · Orientation: Horizontal (16:9) · Style: Professional Clean · Color: ON · Language: English · Voice: Female 2 · Pace: Normal · Music: None
Script
The stop value in range is not included. sum of range from one up to but not including ten is forty five. That adds one through nine. The sum of one through ten is ten times eleven, divided by two. Ten times eleven is one hundred ten. One hundred ten divided by two is fifty five. The call that returns fifty five is sum of range from one up to but not including eleven. An assertion that expects fifty five from the first call fails, and that failure is worth showing. The video uses the assertion that passes. Forty five for the stop at ten. Fifty five for the stop at eleven. The course runs the test, and the spoken numbers are the numbers that passed. Mark the excluded stop on both calls. Forty five and fifty five should both be on the last frame, with the stop that each call excluded.
Video Instructions
The first call stops before ten and sums to forty five. One through ten is fifty five, which is the call that stops before eleven. Show the failing assertion briefly, then the passing one. End with forty five and fifty five and the excluded stops. On-screen labels: sum(range(1, 10)) = 45; 1 through 9; 10 x 11 / 2 = 55; sum(range(1, 11)) = 55.
Voice Instructions
Show the excluded stop. Forty five and fifty five must stay distinct.
Store the version and the printed output
Save the interpreter version, the test file, and the stdout from the run your course just did. A script numeral that does not appear in that output does not belong in the video. If the test fails, fix the lesson or teach the failure on purpose, as the range video does.
This lesson is about the pinned Python. It does not say every language rounds ties the same way. A repeated student question about 0.1 + 0.2 is the mini-lesson linked below.
Make the next lesson the same way
Write the words you want spoken, add the numbers again, and send that script in Script Mode. These two files use a built-in voice and the settings shown above. A later lesson can put the instructor on screen with AI Presenter, use a recording with Own Narration, keep a saved voice with an authorized voice clone, or fix one frame in the frame editor. To generate the file from code, follow the Golpo API v2 pipeline.
FAQ
Can these lessons be generated and published automatically?
Yes, after the test has passed on the pinned interpreter and the script quotes that output. Golpo then renders the script.
Why pair the video with a test at all?
Students hear the result the test just printed, and you can rerun the test when the course changes Python versions.
What does Python’s round do with 0.5 and 1.5?
On the CPython 3 this guide teaches, round(0.5) is 0, round(−0.5) is 0, and round(1.5) is 2.
What is sum(range(1, 10))?
45. The call adds 1 through 9. sum(range(1, 11)) is 55.
Does Golpo run the tests?
No. The course runs them and stores the output. Golpo speaks the script written from that output.
What is stored with the lesson?
The interpreter version, the test file, the stdout, and the script.
Can the video show a failure?
Yes, when the failure is the point. The range video shows that sum(range(1, 10)) is not 55, then shows the call that returns 55.
Who handles a failing test?
The course team. Do not render a video to stay on schedule while the test is still red, unless the lesson’s point is that failure.
Related guides
Tags


