lab07 : min/max, index vs. value

num ready? description assigned due
lab07 true min/max, index vs. value Thu 09/06 11:00AM Fri 09/14 06:30PM

THE DEADLINE FOR THIS ASSIGNMENT IS STRICT.

At the due date/time listed, submissions will be disabled, and whatever you have submitted by that time will be your final submission for this lab.

NO EXCEPTIONS except for true medical/family emergencies with documentation from the Office of Student Life. You are being told NOW to get started and not to put off work on this assignment.

You may pair or work alone on this lab.

Instructions

This lab proceeds in an identical fashion to lab06. The topics are different, but the way of working is the same.

For this lab, you will create two files:

There is starter code for each of these (.py files) at the following link:

I suggest you proceed as follows:

  1. Create a directory called ~/cs8/lab07 (using the mkdir command) and cd into that directory.
  2. Use idle3 (you might try idle3 & if you want to keep your prompt handy) to bring up idle3.
  3. Use “New File” to create empty files called lab07.py and lab07_tests.py in that ~/cs8/lab07 directory.
  4. ONE AT A TIME, copy the function definitions from the starter code, and the tests that go along with those, and get the tests to pass.
    • By one a a time, what I mean is, at your first step, copy ONLY the first function definition from the starter code lab07.py and copy only the test cases from lab07_tests.py that go with that function definition.
    • Then, before you move on to the next function definition and its tests, get all of the tests from the one you just copied to pass.
    • Then, and only then, copy the next function definition and its tests into your files.
    • Repeat this until you have ALL of the function definitions and their tests, and all of them pass.

Note that what you are given differs from function to function: either a complete function definitions

When you’ve done that, you are ready to try submitting to Gradescope for a final grade. HOWEVER, you are encouraged to try submitting to Gradescope earlier, for several reasons:

A Useful tip

As you know, this Unix shell command runs the tests in lab07_tests.py

python3 -m pytest lab07_tests.py

If you have LOTS of tests in your file, and you ONLY want to run some of them, you can use -k string to run ONLY the tests that contain a certain string. For example, suppose you want to focus ONLY on the tests for isList. You can run:

python3 -m pytest lab07_tests.py -k isList

Change isList to any function that you want, and only the tests that contain that string will be run. The others will be “de-selected”.

Submission

Navigate to that page, and upload your lab07.py file.