Plan, build, run, check, and improve one step at a time.
Which line fails first when the user enters 120 and 2.5?
Small checkpoints keep the program understandable.
When the checkpoint works, extend the program by one more small part.
Turn the speed report requirement into a concrete plan.
Input
Distance in km and time in hours
Processing
Divide distance by time
Output
Average speed with km/h
Verify one prompt, conversion, and stored value.
Confirm both inputs before adding the formula.
The program can read both values without an error.
Question
You have just completed the input checkpoint.
What evidence should you collect before adding the formula?
Calculate and inspect the raw result first.
Replace temporary checks with clear final output.
Each test should answer a different question.
Normal Value
Does the main calculation work?
Grouping Boundary
Use values around a change, such as 59 and 60 seconds.
Decimal Value
Did you choose float() where needed?
A program running without an error is not enough. Check whether the result is correct.
Which set gives the best evidence for a ticket total program?
Question
The program reads a decimal ticket price and a whole-number quantity.
A: (10, 2), (10, 2), (10, 2)
B: (18.5, 4), (0, 3), (7.25, 1)
C: (5, 1)
Names, prompts, units, and output should describe the same data.
Carry the Unit
The prompt and output both identify km, hours, and km/h.
Carry the Meaning
Variable names make each calculation readable.
Complete it on time and submit it before the deadline.
Key takeaways from this lesson.
Plan
Identify IPO, variables, conversions, and the formula before coding.
Run Early
Build the smallest working version and run after each addition.
Narrow the Error
The newest small change is the first place to inspect.
Test with Purpose
Compare normal, boundary, and decimal results with expectations.
Turn a list of actions into a reliable build process.
1. Order the seven actions shown below. Keep a Run and Check step after each new program part.
2. Write the ordered actions as comments in a new Python file.
3. Add one short note under each checkpoint describing what you would verify.
Add Output Run and Check Plan Run and Check Add Processing Run and Check Read Input
Fix one connection, run again, and then continue.
1. Run the program and identify the first failing connection.
2. Fix only that issue, then run the program again.
3. Repeat until the calculation and output both work.
4. Test with a decimal ticket price.
Build a complete program through at least three checkpoints.
1. Plan the IPO, variables, conversions, and formula.
2. Build the input, processing, and output in separate checkpoints.
3. Ask for an event name, ticket price, and ticket quantity.
4. Test one whole-number price and one decimal price.
Event name: Science Fair Ticket price: 18.5 Number of tickets: 4 4 tickets for Science Fair cost 74.0 yuan.
Translate a ratio formula and verify a decimal result.
1. Plan the IPO and choose clear variable names for servings and ingredient amount.
2. Ask for original servings, target servings, and the original amount in grams.
3. Translate the formula below into Python. In the formula, a means amount and s means servings.
4. Run after each checkpoint and test a result that contains a decimal.
Original servings: 4 Target servings: 10 Original amount in grams: 300 For 10 servings, use 750.0 g.
Use boundary tests to verify complete groups and a remainder.
1. Ask for a whole number of total seconds.
2. Calculate complete minutes with // and remaining seconds with %.
3. Print the original value and converted result with an f-string.
4. Test with 59, 60, and 125, then compare each result with your expectation.
Total seconds: 125 125 seconds = 2 minutes and 5 seconds.