This is a lab assignment and so you will not be submitting it. However, the concepts and practice will help you on both the homework and quizzes so I encourage you to make a serious effort on it during class and consider finishing it outside of class.

I recommend making a folder for today’s lab in COURSES as you usually do.

Exercise 1

For each snippet, what would it print out to the screen? If you think there will be an error, indicate the line with the error and explain why. After you’ve made a prediction, test out the code.

Exercise 2

  1. Create a new file and write a program to count the number of vowels (“aeiouy”) in a user-given string. You can assume the string is all lowercase.

  2. Update your program so that instead of counting vowels, it asks the user for characters to count in a given string (could be just one, or more than one).

Exercise 3

Now that you know how to make lists of strings, you could make a list of colors or stamps that the turtles use to generate rainbows, random combinations, and other fun creations. Create a program that uses 1) the random module, 2) the turtle module, and 3) a list of colors and/or shapes to generate random turtle artwork.


If you finish early, try out the end of chapter exercises or the XKCD password generator lab for more practice.