tools/debugging-for-beginners-step-through-code-to-find-an-off-by-one.md
Debugging for beginners: step through code to find an off-by-one
Your code prints 6 and you expected 10. A debugger lets you slow the program down, run one line at a time, and watch every variable change, so you can see exactly where reality stops matching your expectation.
Step through a tiny Python function in the page, spot the off-by-one hiding in range(1, n), then learn how to do the same on your own computer with breakpoint() and your editor.