Simple Python Turtle Graphic and Code: Rhombuses

Опубликовано: 12 Февраль 2026
на канале: Basic Python Turtle Art
155
2

A simple image created by identical rhombuses drawn around a central point. The Python Turtle code is also noncomplicated with just around 25 lines.

Feel free to copy the basic Python Turtle code that is given below. Don't hesitate to ask questions about the code if you have any. Enjoy! Please comment, like, or subscribe :)

Incidentally, for more graphics and variations, please visit my author url at https://www.amazon.com/author/basicpy...


import turtle
t = turtle.Turtle() #Definitions and Initializations
screen = turtle.Screen()
t.pensize(4) #Changeable
number_of_rhombuses = 18 #Changeable, preferably 16 to 22
rhombus_size = 105 #Length of rhombus side; Changeable, preferably 95 to 115
def rhombus(): #Procedure for drawing a rhombus
for color in ("purple", "violet"): #For two pairs of consecutive sides; Changeable colors for the side pairs
t.pencolor(color) #Color assignment
t.forward(rhombus_size) #From this to last line line of "for" loop: procedure for drawing one pair of sides
t.left(140)
t.forward(rhombus_size)
t.left(40)
t.penup() #Python_Graphic start of drawing procedure
for i in range(number_of_rhombuses): #Drawing procedure for the indicated number of rhombuses
t.forward(50) #Trail-less movement of turtle from center of graphic
t.right(20) #Turtle direction to starting point of drawing
t.forward(rhombus_size) #Trail-less movement of turtle to starting point of drawing
t.left(40) #Turtle direction to draw the first side of rhombus
t.pendown()
rhombus() #Function call to draw a rhombus
t.penup()
t.home() #Trail-less movement of turtle to default position and direction
t.left((1 + i) * 360 / number_of_rhombuses) #Turtle direction to prepare drawing of next rhombus
t.hideturtle()
screen.exitonclick()