Ga Kay's Chapter 8 Lists Exercises

by Ga Kay Gao

08 Feb 2016

Exercise 1:

Exercise 2:

Exercise 3:

Reflection: I thought these exercises were kind of difficult, especially exercise 2 and 3. I looked over the readings quite a few times but I think the concepts are still a bit fuzzy in terms of exercise 2 and 3. I was just very confused what the question was asking me to do. For exercise 2, I wasn’t sure which line was still not properly guarded. My only thought was the the fact that if you had a sentence with different capitalizations of “from” (such as FROM or From), the code didn’t work. I added the “.lower()” to compensate for it. For exercise 3, I was able to combine the two if statments into one statement but I’m not sure if I did it correctly.

Ga Kay is currently a sophomore studying Information Science at UNC-Chapel Hill. Find Ga Kay Gao on Twitter, Github, and on the web.