Erica's Chapter 3 Exercises

by Erica Brody

27 Jan 2016

Here is the original program - from the logical Turtle exercise. The program allows the user to input a number between 1 and 14, which determines the number of squares drawn. All the squares are green.

Here is the new program which includes 2 functions - one that uses an argument and one that returns a result. The only difference in this program is that each square drawn is a random color.

Reflection: I have now written several programs that check whether the user input is an integer and whether it falls within a prescribed range. However, even When i start with program statements I have written previously to create an if/else nested within try/except to verify that a user has input a number and that the number is within a desired range, I still have to think about how the different loops are working and correct for errors. Hopefully, the logic and syntax will come to more easily as I program more.

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.