Turtle lab

For this lab we get introduced to the python turtle which is a program  that moves a “turtle”  to a certain distance and angle .We are instructed to :

  1. Change the color of the window to “red” using he .bgcolor property of the
    screen variable you create.
  2. Your turtle variable has to have a pen color “white”, you have to use the
    .pencolor property of your turtle variable.  ( I used .color)
  3. You have to make your turtle to change its heading to the right with an
    random angle between 0 and 45 degrees.
  4.  Move your turtle forward a random distance between 0 and 150 pixels.
  5. Then move the turtle backward the same distance than above
  6. Repeat the last three steps 100 times.

This is code that I wrote :

Capture 2

This is the result I got from running my code :

Capture

Leave a Reply

Your email address will not be published. Required fields are marked *