15110 Summer 2017

Lab 4


The purpose of this lab is to get you to work with iteration as a tool for finding a value with a certain property in a sequence of values, and to learn to measure the time consumed by executing some Python code. When you are done, you should be able to


  1. search_timing.py
  2. timings.txt
  3. find_largest_even.py
  4. is_all_odd.py
  5. substring_list_search.py

Place these files in a lab4 folder. Before leaving lab, zip up the lab4 folder and hand in the zip file.

Part 1 - Search and Timing

1.1 Class Activity

Note: The search and timer functions below should be put in the file search_timing.py

1.2 Student Activity

Part 2 - Searching for Numerical Properties

2.1 Class Activity

2.2 Student Activity

Part 3 - Searching with Strings

3.1 Student Activity