Erica's Chapter 6 Exercises

by Erica Brody

06 Feb 2016

This is the code for Exercise 1: I used a word other than banana to keep things interesting

Looking for Exercise 2, there wasn’t one

This is the code for Exercises 3 and 4: I used some of the turtle functionality to add a little fun to these programs

This is the code for Exercise 5:

Reflection: While reading the chapter, I tried the various exercises in a test trinket. I found it helpful to test out some of the functions with actual strings rather than variables assigned to strings. This helped me understand exactly what the code was doing. It took me a while to figure out how to use the loop to print out a word backwards - i think this was because we started with the last letter which is a negative number and counting the negative numbers backward (which makes the numbers bigger), so i thought i needed to add 1 to the counter variable in each loop rather than subtract one. I ended up running the program many times, inserting negative signs in various places in an effort to use the [-1] counting function to count backwards, but i realize now that I ended up using the regular counting, starting with 4 and going down to 0. All that to say, i might have overanalyzed this one

I am a library science student, focused on health information. I am dabbling in information science this semester. Find Erica Brody on Twitter, Github, and on the web.