CS8, Fall 2010

additional challenge problems on lists and strings

Goals for this lab

This lab gives you an opportunity to really practice your problem solving skills. The problems in this lab are a bit more challenging than those in previous labs.

The intention for this lab is to help you prepare for the 2nd midterm and the final. Although the 2nd midterm only covers up to lab07, completing this lab before Tuesday will give you extra practice with all the same concepts—and because the problems are a bit more challenging, you'll really stretch your brain a bit.

Step by Step Instructions

The instructions for this lab are pretty much the same as for lab05.

You'll need to:

  1. Decide whose account you will be working in.
    • Be sure to share the file with each other at the end of each work session, in case your pair partner disappears.
  2. Make a post to the pair partner forum for lab08.
    • Please take the questions there seriously—creative answers about unicorns and vampires are fine as long as you've given us at least two serious answers first.
    • Please make a post there even if you are working alone—though if you are working alone without permission to do so, you may lose points.
  3. Next, read over the entire lab—each of you should do this if you are working in a pair.
  4. Create a directory for lab08 in one of your accounts called ~/cs8/lab08
  5. Bring up IDLE and a window for function definitions, and start a file with the usual stuff at the top (see lab05 for details if necessary), and save the file with the (e.g. lab08.py).
  6. Copy the starting point file into your file and run it:

    The starting point for this week's lab can be found at this link:


    Then open the file, and follow the instructions in the usual way, until the file passes all the tests.

    You may need to find either the call to the go() or the allTests() function and uncomment one or the other. You may also use the go(0,4) function call, adjusting the parameters 0 and 4 to reflect the part of the lab you are working on.

  7. Do your final inspection (see lab05 for the details), and then submit your lab08 directory on CSIL using this command:

    turnin lab08@cs8 lab08



Evaluation and Grading Rubric (150 pts)


Just as in lab07, the following items are deductions that can be made

Points Item

Professional software practices:

  • Naming the file lab08.py
  • Having a comment at the top of the file that complies with the instructions.
  • All @@@ comments have been complied with and removed.
  • Submission follows all instructions
30 concatAllStrings passes its tests and is written with good style
30 onlyTheStrings passes its tests and is written with good style
30 removeItemX passes its tests and is written with good style
30 removeDups passes its tests and is written with good style

Due Date:

But: you are encouraged to start work on it immediately, and finish as soon as possible.

Copyright 2010, Phillip T. Conrad, CS Dept, UC Santa Barbara. Permission to copy for non-commercial, non-profit, educational purposes granted, provided appropriate credit is given; all other rights reserved.