Info

Solutions for Part 1 of the midterm are now available! You can view them here.

Info

We will NOT be answering questions about the midterm during lecture, office hours, or via email. Instead, we will be answering all questions on the Ed board. The course staff will only answer clarifying or logistical questions, and not conceptual questions.

Download, extract, and open

Download the starter code for the midterm. Then, extract (unzip) the contents anywhere on your computer. In VSCode, navigate to File | Open and select the unzipped midterm_22su.py file, which will be used for the first part of the midterm.

Part 1

Here are the problem prompts for Part 1 of the midterm. Write your implementation of the functions in the midterm_22su.py file.

See the function docstrings and the provided assert statements in the template file for more information about each function. The assert statements provided in the template file are NOT exhaustive; we will be running many more tests than what we have provided. You are encouraged to add more assert statements to test more cases.

Make sure to write your name and who you collaborated with in the file header of midterm_22su.py.

Part 2

Navigate to Part 2 of the midterm on Gradescope, which asks more conceptual questions. You must complete both parts in order to receive full credit.

Additional Details

  • We will not be grading on style, but we do recommend good variable names, comments, etc.
  • You may only use parts of Python that have been covered in the class so far.
    • You may NOT use dictionaries or file I/O.
    • You may NOT use the built-in functions min, max, sum, and abs.
    • You may NOT use anything from the math module.
    • You may NOT use things we have not covered, such as recursion, list comprehensions, or lambda functions.
  • Your implementations only need to handle valid type inputs. For example, if the problem says it accepts a list as an argument, you do NOT need to handle the case when a user passes in a string instead.
  • While you are allowed to collaborate on the midterm within the academic honesty policy, you must submit your own answers and write your own code.

Submit

Submit midterm_22su.py under Midterm Part 1 and answer the questions for Part 2 on Gradescope. No late submissions are accepted.