Lab #3 Instructions

First download this script, which sets up the elmstreet array so you don’t have to type it in by hand. Then open the script in IDLE3 and hit F5 to run it. Now you can proceed to the excercises. As before, copy/paste your solutions into your writeup, using a mono-space font for your code and IDLE’s response. Then submit your writeup to sakai as lab3.pdf

Here are some last-minute corrections to the instructions in the textbook:

  • Exercise 4.1.8: Hint should say Use any instead of Use where.
  • Exercise 4.3: Before person1["firstname"] = "William" the example should have person1 = {} to initialize the dictionary.
  • Exercise 4.5.2 should say: Return the first half of x. Your code should work with both odd-length and even-length lists, without creating a warning. Hint: Use len and int.
  • Exercise 4.8: even though I’ve broken down the exercise into three parts, your solution should be a single line of code.