5 questions to test your understanding
A Python program crashes with 'IndexError: list index out of range' on line 47. A student goes directly to line 47 and fixes the index access, but the bug persists. What is the most likely explanation?
A programmer's function produces wrong output. She adds a print statement just before the function returns and sees the value looks correct at that point. What should she conclude?
When reading a Python stack trace, the most useful information about the root cause is usually found on the last line printed.
A logic error is harder to detect than a syntax error because the program runs to completion and only reveals itself through wrong output, not a crash.
Why is forming a hypothesis before changing code the habit that separates effective debugging from ineffective debugging?