Explore

Turtle Programs

Draw Flower In Python Turtle With Code

Draw Flower In Python Turtle With Code

Looking for a tutorial on how to draw flower in python programming then you are at the right place, today in this tutorial I will show you how to draw flower in python turtle with code so read till the end.

To draw a flower in python, I will use the python turtle module which is a GUI library. You can draw things with this in python.

In this tutorial, I will show you how to draw a petal flower in python and how to make a rose in python turtle. It is going to be an interesting tutorial, so read till the end.

Code To Draw Petal Flower In Python


import turtle
turtle.title('Sixteen Petals Flower')
turtle.setworldcoordinates(-2000,-2000,2000,2000)

def draw_flower(x,y,tilt,radius):
    turtle.up()
    turtle.goto(x,y)
    turtle.down()
    turtle.seth(tilt-45)
    turtle.circle(radius,90)
    turtle.left(90)
    turtle.circle(radius,90)

for tilt in range(0,360,30): 
    draw_flower(0,0,tilt,1000)

Above is the code to draw petal flower in python turtle. Create a new folder, open it in a code editor, create a python file and copy and paste the above code. 

As I have said I am using the turtle module to draw flower but you don’t have to install turtle because turtle is preinstalled when you install python.

But still if you get any errors like turtle module missing then you can use the below command to install turtle library.


pip install turtle

Now you can run the above program on your computer or use an online python compiler and below is the final output of this program.

Python Petal flower output

As you can see we have successfully drawn a flower in python turtle now let’s see how to make a rose flower in python.

Code To Draw a Rose Flower In Python


from turtle import *
import turtle as t

t = t.Turtle()
 

t.penup ()
t.left (90)
t.fd (200)
t.pendown ()
t.right (90)
 

t.fillcolor ("red")
t.begin_fill ()
t.circle (10,180)
t.circle (25,110)
t.left (50)
t.circle (60,45)
t.circle (20,170)
t.right (24)
t.fd (30)
t.left (10)
t.circle (30,110)
t.fd (20)
t.left (40)
t.circle (90,70)
t.circle (30,150)
t.right (30)
t.fd (15)
t.circle (80,90)
t.left (15)
t.fd (45)
t.right (165)
t.fd (20)
t.left (155)
t.circle (150,80)
t.left (50)
t.circle (150,90)
t.end_fill ()
 

t.left (150)
t.circle (-90,70)
t.left (20)
t.circle (75,105)
t.setheading (60)
t.circle (80,98)
t.circle (-90,40)

t.left (180)
t.circle (90,40)
t.circle (-80,98)
t.setheading (-83)

t.fd (30)
t.left (90)
t.fd (25)
t.left (45)
t.fillcolor ("dark green")
t.begin_fill ()
t.circle (-80,90)
t.right (90)
t.circle (-80,90)
t.end_fill ()
t.right (135)
t.fd (60)
t.left (180)
t.fd (85)
t.left (90)
t.fd (80)
 
t.right (90)
t.right (45)
t.fillcolor ("dark green")
t.begin_fill ()
t.circle (80,90)
t.left (90)
t.circle (80,90)
t.end_fill ()
t.left (135)
t.fd (60)
t.left (180)
t.fd (60)
t.right (90)
t.circle (200,60)
t.done()

Above is the code to draw rose flower in python. Do the same thing I have told you in the first program.

You can run the program on your computer and below is the final output of this python program 

rose flower python output

As you can see, it successfully draws a rose flower in python turtle. I hope you ran both programs successfully.

Summary

This was a tutorial on drawing flower in python turtle, I hope you found this python tutorial helpful and useful. Do share this guide with your friends or anyone who needs it.

Here are more python drawing tutorials for you:

I hope you found what you were looking for from this python tutorial. If you want more python tutorials like this, do join our Telegram channel for future updates.

Thanks for reading, have a nice day 🙂