CSCI 150 - Foundations of Computer Science

Spring 2012

Programming Assignment #7

Due: Friday, March 2, 2012 at 11:10 am

Reading assignment:

Programming problems

Searching and Sorting

Other Chapter 4 Problems

List Comprehension Problems

Rewrite all of the functions below to use list comprehensions. These functions were assigned in Homework 6. The list of functions to be reimplemented is:

File Input Problems:

For each of these problems, write the solution as a function, using the function names given below. The file name will be a parameter to each function. Instead of printing the output, your function should place each line of output in a list, and then return the list.

Additional problems