For each of the exercises, run the code and gather as much information as you can about the source of the error, based on the code's output. For example, you may want to answer the questions:
- What is the expected vs. the actual output?
- What error message (if any) is there?
- What line number is causing the error?
- What can you deduce about the cause of the error?
You don't actually need to find and fix the error yet! We'll do that in the next step.
If you have trouble with this part, you can check out example.py
to see how to do it.
For each of the exercises, read over the code line-by-line with a partner. For each line of code, state any assumptions you have about how the code behaves. E.g. "the i
variable is set to the index of the next element." For each assumption, add a print statement to the code to verify that your assumption is accurate. E.g. you can print out the i
variable and check its value(s) against what you expect.
If you have trouble with this part, you can check out example.py
to see how to do it.