Turtle Graphics

What is Turtle Graphics?

Turtle Graphic is a toolkit that provides a simple and enjoyable way to draw pictures in a window.


Using the turtle and random modules from Python, write a program (or script) to create an output screen as the one shown in the figure below.

To achieve this output you have to do the following:turtleg1

  • Change the color of the window to “red” using wn.bgcolor property of the screen variable you create.
  • turtleg2Your turtle variable has to have a pen color “white”, you have to use the .pencolor property of your turtle variable.
  • You have to make your turtle to change its heading to the right with an random angle between 0 and 45 degrees.
  • Move your turtle forward a random distance between 0 and 150 pixels.
  • Then move the turtle backward the same distance than above
  • Repeat the last three steps 100 times.