Learn to Code via Tutorials on Repl.it!

← Back to all posts
Spirograph tutorial.
CoolPanda123 (1)

Hello everyone! this is my tutorial on how to create a Spirograph in Python(with Turtle).

from turtle import *
d = Screen()
for i in range(6):
  for colors in ["red","blue","magenta","green","yellow","white"]:

from turtle import * : This line says to python to import everything from the turtle module.
pensize : is the size of your pen.
speed : is the speed of the turtle.
d : is a variable that I used.
Screen() : it can be used to change the background color of the turtle.
bgcolor : I used this to change the background color.
for i in range(): : is used to loop something for a certain amount of times.
for colors in ["red","blue","magenta","green","yellow","white"]: : for changing the color of the turtle.
circle : used to make a circle in turtle.
left : used to move left a certain amount of degrees.
color(colors) : changes the color to the colors in ["red","blue","magenta","green","yellow","white"].

Thank You!