# Drawing a Spirograph using Turtle in Python

Turtle visuals are typically associated with the Logo programming language. To assist his version of the turtle robot, which really is a straightforward robot controlled from the user's workstation and built to perform the drawing work allocated to it to use a small collapsible pen set into or attached to the robot's body, Seymour Papert decided to add turtle graphics support to Logo in the late 1960s.

A Turtle graphics module is now part of the Python language's standard library. Like its forebear in Logo, Turtle in Python enables programmers to control one or even more turtles in a 2D space.

## Describing the syntax :

The three characteristics of the turtle are a place, an orientation and a pen. The pen's attributes include colour, width, and on/off state (also called down and up).

The turtle reacts to commands based on its present location, such as "go ahead 50 spaces" and "turn right 90 by degrees". You can control the turtle's pen by turning it on, altering its colour, and customising its width. A student can understand (and foresee and reason about) the turtle's motion by picturing what they would do if they were the turtle. Seymour Papert refers to this as "body syntonic" reasoning.

## Introduction to a Spirograph :

The Spirograph is a geometric drawing tool that produces the mathematical gaming curves known technically as hypotrochoids and epitrochoids. The renowned toy version was built by British engineer Denys Fisher and first made available in 1965.

The first Spirograph, which was only sold in the US, was composed of two plastic rings (or stators) of various sizes, each with helical gears on both the both in and out of circumferences. Once either of these rings was set in place, any of the numerous gearwheels (or rotors) that were available, each with openings for a ballpoint pen, could be rotated around the ring to draw geometric shapes (either by glue, pins or even by hands). Later, straight bars, rings, and triangles were added to the Super-Spirograph.

## Drawing a Spirograph :

To draw a spirograph in Turtle in Python, we will first import the turtle Library to our Python code.

Now we will be setting the background colour using the method screen() and bgcolor(). Moreover, we will set the size of the pen (turtle) using the pensize() method and mention the speed of drawing the required figure using the speed() method.

Now a for loop will be used to execute a particular piece of code six times in order to complete a Spirograph. In this loop, the colours to be used will be mentioned and used with the help of the color() method by taking each mentioned colour one by one. Also, the shape of the drawing will be specified using the circle() method with a particular size. And lastly, the left() method will also be used in order to move the turtle to the left of the present location every time a circle is completed.

Finally, the turtle will be hidden using the hideturtle() method and the program will be completed, giving the required Spirograph as an output.

Output: