Monday, September 29, 2025
HomeLanguagesDraw Spiraling Star using Turtle in Python

Draw Spiraling Star using Turtle in Python

Prerequisite: Python Turtle Basics

Turtle is an inbuilt module of python. It enables us to draw any drawing by a turtle and methods defined in the turtle module and by using some logical loops. To draw something on the screen(cardboard) just move the turtle(pen).To move turtle(pen) there are some functions i.e forward(), backward(), etc
Approach to draw a Spiraling Star of size n: 

  • import turtle and create a turtle instance.
  • Using for loop(i=0 to i<n) and repeat below step
    • turtle.forward(i*10)
    • turtle.right(144)
  • close the turtle instance.
     

Python3




# importing turtle module
import turtle
  
# number of sides
n = 10
  
# creating instance of turtle
pen = turtle.Turtle()
  
# loop to draw a side
for i in range(n):
    # drawing side of 
    # length i*10
    pen.forward(i * 10)
  
    # changing direction of pen 
    # by 144 degree in clockwise
    pen.right(144)
  
# closing the instance
turtle.done()


Output: 
 

 

RELATED ARTICLES

Most Popular

Dominic
32324 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6695 POSTS0 COMMENTS
Nicole Veronica
11860 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11918 POSTS0 COMMENTS
Shaida Kate Naidoo
6807 POSTS0 COMMENTS
Ted Musemwa
7073 POSTS0 COMMENTS
Thapelo Manthata
6763 POSTS0 COMMENTS
Umr Jansen
6771 POSTS0 COMMENTS