Assigned Date: Tuesday, Feb. 16, 2010
Due Date: Thursday, Feb. 25, 2010
Due Time: 1:30pm
Last modified on February 22, 2010, at 12:29 PM (see updates)
This assignment focuses on:
This is a pair-programming assignment (i.e., you may work with one partner). You may discuss the assignment only with your partner or the instructor.
Complete the following recursive function definitions:
def member(item, aList)-- returns
def myLength(aList)-- returns the length of
def myReverse(aList)-- returns
def myMap(function, aList)-- applies
functionto the each element of
aList. You may assume that function is unary (i.e., it expects a single argument).
def myFilter(function, aList)-- similar to Python's
def myReduce(function, aList)-- similar to Python's
reduce(). Accordingly, it should raise a
TypeError, if called with an empty sequence. You may assume that function is binary (i.e., it expects only two arguments).
def mapBoolean(aList)-- returns a list of boolean values, where each boolean is the truth value of the corresponding
def countItem(item, aListOfLists)-- returns a count of how many times
aListOfLists, regardless of list level (i.e., how deeply embedded it is).
tail(), if you wish.
Follow the Golden Rule of Style: "A program should be as easy for a human being to read and understand as it is for a computer to execute." 
In general, you should comment any variable, obscure statement, block of code, method, and class you create.
Your comments should express why something is being done, as opposed to how – the how is shown by the code.
Each unit (e.g., function, class, etc.) should start with a doc string. This comment should follow the doctest style, since it allows to:
In this course, you should always include opening comments as follows:
Your grade will be based on how well you followed the above instructions, and the depth/quality of your work.