Midterm Exam

Midterm grades are released! The answer key can be downloaded here.

Info

The Midterm exam will be during class time on Wednesday, 31st Jan 2024. Be on time! We will aim to start promptly at 4:35pm in order to give as much time as possible to complete the exam. No matter when you arrive, we will “call time” (pencils down, exam is done) at exactly 5:20pm. As such, if you arrive late, you get less time!

What to bring

  • Yourself.
  • Your UW ID card.
  • A pen or pencil and eraser.
  • Water
  • A 1-page cheatsheet
    • Note: we will provide a reference sheet that includes some documentation that you won’t have to memorize or include on your own cheatsheet.
    • Note 2: This reference sheet may change between now and the exam date.
    • 1-page means a single 8.5”x11” (US Letter) sized piece of paper, front and back.

Where to sit

We will have a seating chart, organized by section. You can see the seating chart here.

Format

This is a hand-written test, meaning NO ELECTRONIC DEVICES of any kind allowed. Any math on the exam will be limited to simple arithmetic; we’re assessing for Python and programming, not for math!

Question types may include some of the following. Note: this is not an exhaustive list, nor will all of these formats appear. This list is meant to give you an idea of what might possibly appear on the exam.

  • Given a program, function, or code snippet and possible inputs, what is the output?
  • What is the value of variables X, Y, Z on line N?
  • Fill in the code: Replace the blanks on line N with an appropriate statement or expression
  • Evaluate expressions
  • Write a function that takes … and returns …

Topics

Every topic up to the lecture before the midterm is fair game for appearing on the exam. The one caveat is Dictionaries, to be introduced the Monday before the exam: you will not be expected to be proficient in this topic, and thus it will be weighted appropriately.

The short list of topics are:

  • Variables, Statements, Expressions
  • For loops, range, nested loops
  • If statements and conditionals
  • Functions, function arguments, and return statements
  • Lists
  • File input/output (I/O)

Practice

Warning

Exams from past quarters are either completely different, contain possibly outdated practices, or simply happened at different points in the quarter. When in doubt about whether a topic will be covered or if an answer key seems different than you expect, ask on Ed.

Here is a practice exam from Spring 2023:

These past quarters’ midterms may be helpful in practice and studying:

Some notable differences (this list may be updated over time):

  • print statements are missing parentheses. They are now required.
  • Division prior to 23wi worked differently: with the current version of Python, division by default produces floats. For example 3 / 5 evaluates to 0.8. To do “truncated” division, producing an int, use a double slash: 3 // 5 evaluates to 0.
  • Any “draw the environment” questions will not be on this quarter’s exam, and you can skip or ignore those questions from past exams.
  • itemgetter and tuples (things that look like (1, 2)) will not be on this quarter’s midterm.
  • These exams are slightly longer than what you should expect this quarter.
  • All exams prior to 2020 used an older version of Python. You should assume that everything this quarter is with Python 3.11. (If this means nothing to you, don’t worry about it!)