Practice Questions

This section includes practice questions for the entire course.

For a list of practice questions that you should focus on for the midterm exam, click on the link below entitled:

Click here for list of which questions to study for the MIDTERM (2023)

Note that in adition to the questions in this section, there are also many practice questions that are included in the actual text of the chapters.

About these questions/answers

The answers to each question were written to explain how to think about arriving at the answer.

The actual answer is on the line containing the comment #ANSWER. All other lines are there to demonstrate the answer working on actual data or to demonstrate portions of the whole answer so that the whole answer is more easily understood. If the actual required code for an answer takes up several lines then the comment will say #ANSWER (MULTIPLE LINES).

If different possible answers are shown, then the different answers will be displayed with the comment #ALTERNATE ANSWER or #ANOTHER ANSWER.
Note that it is very possible that there are valid answers other than the ones shown below.