< Back

Post Lab 7

Post labs are to be done individually. Sharing files between students is not allowed. Doing so is an Academic Integrity violation, and will be treated as such.


sample_color.py

A Spirograph is a toy that helps kids create designs out of curves. The Spirograph mounts a pen in a series of gears that when actuated create mesmerizing geometric curving designs. In this post-lab you will demonstrate your understanding of loops by using the turtle module to draw a line spiralgraph.

Details

Create the function draw_spiralgraph(line_length) in a file called spiralgraph.py. The parameter line_length specifies the length of the lines used to draw the spiralgraph. There are many turn angles that will create beautiful spiralgraph drawings. Try different angles and pick one you like. The number of times the function draws lines should the fewest needed to draw a complete the spiralgraph for the angle you have chosen. Test your function by calling the function multiple times with different parameters. Make sure your code follows the courses code conventions.

Example

turtle.up()
turtle.goto(-200, 0)
turtle.down()
turtle.color('red', 'yellow')
turtle.begin_fill()
draw_spiral(200)
turtle.end_fill()
turtle.up()
turtle.goto(0, 0)
turtle.down()
turtle.color('thistle', 'peachpuff')
turtle.begin_fill()
draw_spiral(200)
turtle.end_fill()
Turtle Graphics Spiralgraph

Submission

Submissions for post labs are to be done via the inquire system. Go to http://inquire.roanoke.edu/ You should see a section for post labs. Submit your .py file to the appropriate post lab location.

Post labs are to be done individually. Sharing files between students is not allowed. Doing so is an Academic Integrity violation, and will be treated as such.