ChEn263 — Lecture 9
Lecture 9 - Debugging
- This lecture discusses stategies for debugging your python code. Specifically, I talk about the programming cycle and different types of bugs, and I give some of my best tips for debugging code. Note that the video below also includes the examples, but separate links are given below for your convenience.
Examples
- In this example, I debug a nested loop using the principles I discuss in the lecture above. (The video starts at Example 1.)
-
In this example, I debug a plot made with
matplotlib.pyplot
. (The video starts at Example 2.) Note that at the end of the video I make two mistakes: (1) I omit some parentheses and (2) I forgot to change a power from 1/2 to 2.