Draw Concentric Circles with VIBGYOR Using Turtle in Python

Prerequisite: Turtle Programming Basics

Turtle is an inbuilt module in Python. It provides drawing using a screen (cardboard) and turtle (pen). To draw something on the screen, we need to move the turtle (pen). To move turtle, there are some functions i.e forward(), backward(), etc.

To draw Concentric VIBGYOR :

Following steps are used :

  • Importing turtle module
  • Set a screen
  • Make Turtle object
  • Define a method for circle with dynamic radius and colour.
  • Write text by setting turtle object at required position.

Below is the implementation :






# import turtle package
import turtle
# Screen object
sc = turtle.Screen()
# Screen background color
# turtle object
pen = turtle.Turtle()
# turtle width
# function to draw a circle of
# rad radius and col color
def circle(col, rad, val):
    # set position for space
    pen.setpos(0, val)
# function to write text
# by setting positions
def text():
    pen.setpos(-100, 140)
    pen.write("Concentric VIBGYOR",
              font = ("Verdana", 15))
    pen.setpos(-82, -188)
    pen.write("Using Turtle Graphics",
              font = ("Verdana", 12))
# Driver code
if __name__ == "__main__" :
  # VIBGYOR color list
    col = ['violet', 'indigo', 'blue',
         'green', 'yellow', 'orange',
  # 7 Concentric circles
  for i in range(7):
      # function call
      circle(col[i], -20*(i+1), 20*(i+1))
  # function call


Output :

Concentric Vibgyor

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Improved By : pulkitagarwal03pulkit

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.