Skip to content
Related Articles

Related Articles

Improve Article
Colored Flower by circles using Turtle in Python
  • Difficulty Level : Hard
  • Last Updated : 01 Aug, 2020

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 Flower :

Following steps are used :

  • Import Turtle
  • Set screen
  • Make Turtle Object
  • Define colors used for drawing
  • Loop to draw circles oriented by angle.

Below is the implementation :


# import turtle package 
import turtle
# screen object
sc = turtle.Screen()   
# turtle object
pen = turtle.Turtle()  
# Driver Code
# colors
col = ['violet', 'indigo', 'blue', 'green'
       'yellow', 'orange', 'red']
# screen size
# screen color
# turtle size
# turtle object
# integer variable 
# for accessing colors
i = 0
# loop to draw 30 circles 
for angle in range(0, 360, 12):
  # color of circle
  if i == 6:           
    i = 0
    i += 1
  # Set the orientation of
  # the turtle to angle
  # circle of radius 80
# hide the turtle

Output :

Coloured flower by circle

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :