Homework 4: Turtle Art

Assigned
Monday September 12, 2016
Due
noon., Friday September 16, 2016
Summary
The goal of this assignment is to get a little experience with graphics programming, writing a function, and using the turtle module.
Collaboration
Do this assignment with a partner of your choice, or on your own.
Submitting
Submit a Python program using the online turnin form. See below.
Scoring
10 points

Preparation

  1. Create a directory called graphicsintro that will hold all of your work for this assignment.

  2. Save the my_artwork.py module into your graphicsintro directory, and open it up. Read through the code and see if you can figure out what it will do.

  3. Start a terminal and open a Python interpreter. At the Python prompt, type as follows:

    >>> import my_artwork
    >>> my_artwork.drawpic()

    What do you see?

  4. Try modifying the program to accomplish the following:
  5. Some of the documentation for the Turtle class is in the textbook. Take a few minutes to skim through the documentation to familiarize yourself with what is there. Then try picking out a few methods that look like they might be interesting, and try them out. Modify your program to use other methods from the book.

Assignment

Write a Python program named drawing.py. Your program should create a Turtle object and use the methods in the book to draw a picture.

Put the code that does this drawing inside a function named drawpic, so your code can be run in the same way as the code is run in my_artwork.py. Spend a little bit of time experimenting with the different methods, and then figure out how to combine these methods to draw more complex shapes or pictures.

Some ideas:

Be creative, and have fun!

Submitting your work

Submit one file, drawing.py, using the turnin form.


Janet Davis (davisj@whitman.edu). Adapted from an assignment by Andy Exley.

Created September 12, 2016
Last revisedSeptember 12, 2016, 02:21:07 PM PDT
CC-BY-NC-SA This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.