Skip to content
Related Articles
Open in App
Not now

Related Articles

Print a Spirograph using turtle in Python

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 11 Sep, 2021
Improve Article
Save Article

Pre-requisites: Turtle Programming in Python

A spirograph is a very interesting geometrical figure which is often symmetrical to both the axes. It produces mathematical roulette curves of the variety technically known as hypotrochoids and epitrochoids. Here, we’ve used a range of colors to draw circles, you can use your combination as per your color choice.

Below is the implementation.


# Import the turtle library for
# drawing the required curve
import turtle as tt
# Set the background color as black,
# pensize as 2 and speed of drawing
# curve as 10(relative)
# Iterate six times in total
for i in range(6):
      # Choose your color combination
    for color in ('red', 'magenta', 'blue',
                  'cyan', 'green', 'white',
        # Draw a circle of chosen size, 100 here
        # Move 10 pixels left to draw another circle
    # Hide the cursor(or turtle) which drew the circle




My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!