Turtle Graphics

Turtle graphics

Create the following turtle graphic

The following lab should be uploaded on your ePortfolio when is finished.

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:

  • Change the color of the window to ā€œredā€ using wn.bgcolorproperty of the screen variable you create.
  • Your 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

For this assignment, I had to use turtleĀ graphic to create a flower. First, I had to import turtle and random modules. Then follow the instruction above and use the range function to repeat it 100 times.

james-py-c__users_james_desktop_james-py-3-5-2-10_6_2016-8_53_14-pm

python-turtle-graphics-10_6_2016-8_51_19-pm