Midterm 2 Exam Topics
NoteUpdated for Winter 2025
The test will include many concepts from Midterm 1, such as:
- if statements
- loops
- lists
- dictionaries
- ranges
- comparisons
- name binding
- list comprehensions
- dictionary comprehensions
- file input/output
- modulus
- floor division
Additionally, Midterm 2 may include any or all of the following topics:
- iterators
- generators
- higher order functions
- lambda functions
- decorators
- exception handling (
try
/except
) - types of exceptions (
IndexError
,ValueError
, etc.) - command line arguments (
sys.argv
) - generating random numbers
- recursion
- classes and objects
- inheritance
- dunder functions
- linked lists
- trees
- tree recursion
- mutable vs. immutable data types
Students preparing for Midterm 2 should make sure they know which data types are mutable, and should also know the meaning of the following terms:
- functional programming
- object-oriented programming
- recursion
- mutability
- exception
- testing
- imperative programming language
- declarative programming language
- side effect
- pure function
- modularity
- abstraction
- docstring
Good ways to study would be:
- Go through the list of recommended topics and make sure you understand them.
- Review material from labs and lecture slides.
- Get together with a group of other students to go over material.
- Attend the midterm review in your lab sections this week.
Example Exams
WarningThe actual exam will be very different from these examples. They are provided to help give an idea of the format of the exam.
See the list of topics for exactly what will be on the exam.
Exam | Sample Test | Answer Key |
---|---|---|
Midterm 2 | Sample exam | Solutions |