Becca's Chapter 8 Exercises

by Becca Greenstein

07 Feb 2016

Here is 8.1:

Here is 8.2:

Here is 8.3:

General Question: What does .md stand for/mean in my post titles?

8.1 Reflection: This one was relatively straightforward. I learned the hard way that if you change a list (delete_head), the indices change also. I printed out the intermediate lists for quality control purposes.

8.2 Reflection: It wouldn’t let me add the mbox-short.txt file to a new tab in Trinket. I had to give it a new name - not entirely sure why.

The original function was printing the third word on any line that started with the word “From.” I tested this by adding the word “bunny” before “Sat” in Line 1 and it printed bunny.

To fix this, the program needed to print only the days of the week. I added an if statement and a list with the appropriate weekday abbreviations so “bunny” wouldn’t print. It didn’t!

8.3 Reflection: This exercise took me a little while, but I think that was mainly because it is poorly phrased. I didn’t realize we had to both add an “and” operator AND change the phrasing of the if statements for a bit. I figured this out once I put “or” in instead and it worked.

Becca is a second-semester MSLS student in SILS. She likes science, words, the outdoors, and helping people. Find Becca Greenstein on Twitter, Github, and on the web.