Loops & Decisions Clinic.
Six coding investigations in real Python: classify latency, count offline devices, fix range boundaries, terminate a while loop, distinguish break from continue, and audit a simulated port inventory.
How to use this clinic: Choose a task, predict the output, edit or build the script, and run it. Then check your solution against the requested output and variables. If a while loop doesn't terminate, the runner stops it rather than letting it run indefinitely.
Review the lesson →Write it. Run it. Understand it.
Write decisions and loops, inspect each iteration, and use feedback to verify the exact result.
Classify latency without overlapping rules
Northstar classifies latency at 200 ms or higher as Critical, at 100–199 as Warning, and below 100 as Normal. The current test is 240 ms. Fix the decision order so the exact output is 'Critical'; keep the result in the variable severity.
CriticalTry solving it before asking for help. Hints never show a completed program.
Your printed output and errors will appear here.
Run the code, then step through the executed lines to watch variable values change.
