Course Home | Class Schedule | Assignments | Git Submission | Perusall | Python | Tutoring

Saint Louis University

Computer Science 1300/5001
Introduction to Object-Oriented Programming

Michael Goldwasser

Fall 2018

Computer Science Department

Homework Assignment 08

Conditional statements

Contents:


Overview

Topic: Conditional statements and list comprehensions
Related Reading: Chapter 08
Due: 10:00am, Wednesday 26 September 2018

Please make sure you adhere to the policies on academic integrity.


Problems to be Submitted (20 points)

  1. (10 points)

    Lists support a method to count the number of times that a specified value appears in a list. Show that you can compute such a count without relying upon that method. Specifically, assume that you have a list named collection and a target value. You are to write a code fragment that computes the number of times that value appears in the given collection.

  2. (10 points)

    Assuming that words is a list of strings. Write a code fragment that computes a new list named palindromes that contains all words having length five or greater that are spelled the same backward and forward (e.g., 'kayak').


Michael Goldwasser
CSCI 1300/5001, Fall 2018
Last modified: Tuesday, 25 September 2018
Course Home | Class Schedule | Assignments | Git Submission | Perusall | Python | Tutoring