You'll also greatly benefit from learning some debugging techniques such as liberal use of print statements, commenting and reintroducing portions of code, and the use of your debugger to step through code and watch variables.

Especially the last one.