Draw a Flower Using Python Turtle

As a Python developer with over a decade of experience, I’ve always enjoyed using the Turtle graphics library to create visual art and teach programming concepts. One of my favorite projects is drawing flowers because it’s both simple and visually rewarding.

In this tutorial, I’ll walk you through multiple methods to draw a flower using Python’s Turtle module. The steps are simple, and you’ll see how easy it is to create vibrant flowers programmatically.

By the end, you’ll have the skills to customize your flower and even build more complex designs.

Methods to Draw a Flower Using Python Turtle

Now, I will explain to you the methods to draw a flower using Python Turtle.

1- Draw a Simple Flower with Repeated Petals

This method uses a loop to draw petals in a circular pattern. It’s a great way to understand how loops and angles work in Turtle.

Step-by-Step Instructions

  1. Set up the screen and turtle:
import turtle

screen = turtle.Screen()
screen.bgcolor("white")

pen = turtle.Turtle()
pen.color("red")
pen.speed(10)
  1. Create a function for a single petal:
def draw_petal():
    pen.circle(100, 60)  # Draw one side of the petal
    pen.left(120)
    pen.circle(100, 60)  # Draw the other side
    pen.left(120)
  1. Draw the flower by repeating petals:
for _ in range(6):  # Six petals
    draw_petal()
    pen.left(60)
  1. Add a stem:
pen.right(90)
pen.color("green")
pen.forward(200)
  1. Finish drawing:
turtle.done()

This code draws six red petals arranged in a circle with a green stem. The circle method draws arcs, and by carefully adjusting the angles, you get petal shapes. The loop repeats the petal six times, rotating the pen to position each petal correctly.

I executed the above example code and added the screenshot below.

flower python

Read Python Turtle Star

2- Draw a Flower with Filled Petals and Center

If you want a more colorful flower, you can fill the petals and add a center circle.

Step-by-Step Instructions

  1. Initialize the turtle:
import turtle

pen = turtle.Turtle()
pen.speed(10)
pen.color("purple")
  1. Draw a filled petal:
def draw_filled_petal():
    pen.begin_fill()
    pen.circle(100, 60)
    pen.left(120)
    pen.circle(100, 60)
    pen.left(120)
    pen.end_fill()
  1. Draw multiple petals with fill:
pen.fillcolor("pink")

for _ in range(8):  # Eight petals
    draw_filled_petal()
    pen.left(45)
  1. Draw the flower center:
pen.up()
pen.goto(0, -20)
pen.down()
pen.color("yellow")
pen.begin_fill()
pen.circle(20)
pen.end_fill()
  1. Complete the drawing:
turtle.done()

This method creates a flower with eight pink petals and a yellow center, giving it a more natural look. Filling shapes adds vibrancy, and positioning the center circle completes the flower’s appearance.

I executed the above example code and added the screenshot below.

how to draw a flower in python turtle

Check out Python Turtle Oval

3- Use Functions and Parameters for Custom Flowers

Once you’re comfortable, you can create functions that accept parameters to customize your flower’s size, color, and number of petals.

Example Code

def draw_custom_flower(petal_color, center_color, petal_count, petal_radius):
    pen = turtle.Turtle()
    pen.speed(10)
    pen.color(petal_color)
    pen.fillcolor(petal_color)

    def draw_petal():
        pen.begin_fill()
        pen.circle(petal_radius, 60)
        pen.left(120)
        pen.circle(petal_radius, 60)
        pen.left(120)
        pen.end_fill()

    for _ in range(petal_count):
        draw_petal()
        pen.left(360 / petal_count)

    pen.up()
    pen.goto(0, -petal_radius/3)
    pen.down()
    pen.color(center_color)
    pen.fillcolor(center_color)
    pen.begin_fill()
    pen.circle(petal_radius / 3)
    pen.end_fill()

    pen.hideturtle()

draw_custom_flower("orange", "red", 10, 80)
turtle.done()

This function lets you draw flowers with any number of petals, colors, and sizes. For example, the code above draws a flower with 10 orange petals and a red center. You can easily change the parameters to create a variety of flowers.

I executed the above example code and added the screenshot below.

python flower code

Read Python Turtle Cheat Sheet

Tips for Drawing Flowers with Python Turtle

  • Experiment with colors: Use color names or hex codes to customize your flower palette.
  • Adjust speed: Use pen.speed() to control drawing speed. Higher values draw faster.
  • Use loops: Loops make it easy to repeat petals and patterns.
  • Combine shapes: Mix circles, arcs, and lines to create more complex flowers.
  • Save your work: You can save the Turtle screen as an image using additional libraries if needed.

Drawing flowers using Python Turtle is a fun way to combine programming with creativity. Whether you’re teaching kids in the USA or just exploring Python graphics, these methods provide a solid foundation. The beauty of Turtle lies in its simplicity and the instant visual feedback it offers.

Try customizing the petals, colors, and shapes to make your unique flower designs. With a little practice, you’ll be creating stunning graphics that showcase your Python skills and artistic flair.

You may like to read other turtle-related articles:

51 Python Programs

51 PYTHON PROGRAMS PDF FREE

Download a FREE PDF (112 Pages) Containing 51 Useful Python Programs.

pyython developer roadmap

Aspiring to be a Python developer?

Download a FREE PDF on how to become a Python developer.

Let’s be friends

Be the first to know about sales and special discounts.