Turtle Graphics

In this lesson we learned how to use the module turtle graphics create visual designs. We started by working with basic commands to draw squares, as well as the range function to create loops, essentially shortening the code and eliminating repetitiveness.

turtle

turtlerange

turtlepic

The next step in this lesson was to use more complex commands such as speed, and functions from the random module, like random range, to produce different results each time. The aim was to have a unique figure after the set of commands was repeated 100 times.

turtlerandomcode turtlerandom

The end result was something similar to the figure above, having lines of random lengths at various angles, altering between 0  and 45 degrees.