lab03a : Conditionals, Nested Control Structures, and Loops

num ready? description assigned due
lab03a true Conditionals, Nested Control Structures, and Loops Thu 01/23 12:00AM Sun 02/23 12:00AM

This lab, originally lab03 from Summer 2019 (by Prof. Richert Wang), offers more opportunity to practice the skills from lab03.

There is some overlap with the other labs in the course, but also some new material as well.


In this lab, you’ll get more practice with:

Instructions

In this lab, you will need to create two files:

Starter code is provided for you and are located at (you may need to refresh the page if the links do not load immediately):

You will complete the portions in the starter code by doing the following:

  1. Create a directory called ~/cs8/lab03a (using the mkdir command) and cd into that directory.
  2. Use idle3 (you might try idle3 & if you want to be able to type commands on your terminal window after IDLE opens).
  3. Use “New File” to create empty files called lab03a.py and lab03a_tests.py in that ~/cs8/lab03a directory.
  4. ONE AT A TIME, copy the function definitions from the starter code, and the tests that go along with those functions, 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 lab03a.py and copy only the import statements and test cases from lab03a_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.

You are encouraged to try submitting to Gradescope periodically for several reasons:

Upload lab03a.py and lab03a_tests.py to Gradescope.

Once you’re done with writing your functions, navigate to the Lab assignment “Lab03” on Gradescope and upload your lab03a.py and lab03a_tests.py files.