Skip to content
Related Articles

Related Articles

Draw Black Spiral Pattern Using Turtle in Python

View Discussion
Improve Article
Save Article
  • Last Updated : 01 Oct, 2020
View Discussion
Improve Article
Save Article

Prerequisite: Turtle Programming in Python

“Turtle” is a Python feature like a drawing board, which lets us command a turtle to draw all over it. This module comes packed with the standard Python package and need not be installed externally.

Functions used:

  • forward(value): It moves the turtle in forward direction.
  • speed(value): It changes the speed of the turtle.
  • left(value): It moves the turtle towards the left.

In this article, we will discuss how to draw a Black Spiral Pattern Using Turtle Graphics.

Approach:

  • Import turtle
  • Initialize the variable.
  • Initialize the turtle.
  • Start making the pattern according to your logic.

Below is the implementation of the above approach.

Python3




# import turtle
import turtle
  
# initialising variables
dist = 1
flag = 500
  
# initialising turtle
spiral = turtle.Turtle()
  
# changing speed of turtle
spiral.speed(10)
  
# making patten
while flag:
    
    # makes the turtle to move forward
    spiral.forward(dist)
      
    # makes the turtle to move left
    spiral.left(120)
    spiral.left(1)
    dist += 1
    flag -= 1
  
turtle.done()

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!