This question evaluates debugging skills and understanding of loop termination and control-flow correctness in Python, emphasizing practical familiarity with debugging tools and techniques for isolating faulty loop conditions.
You are given a Python script that appears to hang or produce incorrect results because of a bug in a loop condition (e.g., while/for termination logic).
Explain how you would debug it systematically to find the faulty loop condition and fix it. Include what tools/techniques you would use (prints, logging, debugger, unit tests) and what common loop-condition mistakes you would check for.