COSC 101: Exam 2
Concepts covered
The second midterm exam covers up through chapters 8 in the text. The exam is cumulative. The new concepts since the last exam include:
- functions: defining and calling
- how functions work: parameter passing, return values, variable scope
- docstrings and doctests
- nested for loops
- while loops
Study tips
- Do practice problems.
- Write out your answer on paper (computers are not permitted during the exam!) Once you have an answer, test it by tracing your code by hand. Then you may find it useful to type it into a computer and run it in IDLE or Python Tutor’s Visualize.
- Avoid looking at the solutions until you’ve spent at least 15-30 minutes trying to solve the problem on your own.
Study materials
- Problems from class (slides, handouts, etc.)
- Exercises from readings
Many of the problems on Exam 2 in previous semesters involve lists or string indexing/slicing, which have not yet been covered this semester and will not be on Exam 2 this semester. The following previous exam problems are good practice problems as you prepare for Exam 2 this semester:
- Problem 2a from Spring 2017 Exam 2
- Problems 2a and 2c from Fall 2017 Exam 2
- Problem 5a from Fall 2018 Exam 2
- Problem 4 from Spring 2019 Exam 2
- Problems 2 and 4 from Spring 2020 Exam 2
For additional practice problems, see the Exam 2 Review worksheets from various class sections this semester: