In this tutorial, we will discuss a step-by-step guide on How To Draw A Flower In Turtle Python With Source Code for free.
The code is very simple and easy to understand. So let’s start.
What is Turtle Python?
Python Turtle is a feature like a drawing board, which lets us command the turtle to draw all over it! which can move the turtle around with the use of functions like turtle.forward() and turtle.right()
Draw A Flower Using Turtle In Python
Here’s a step-by-step guide on How To Draw A Flower In Python Turtle with Source Codes.
Step 1: Import Python Turtle Library
First, we will import the Python Turtle Library so that we can access the function of the program.
Here’s the code:
import turtleStep 2: Set Initial Position
Next, we will set the initial position of the turtle.
Here’s the code:
# Set initial position
turtle.penup()
turtle.left(90)
turtle.fd(200)
turtle.pendown()
turtle.right(90)Step 3: Start Draw The Flower
Now, let’s start to draw the flower.
Here’s the code:
# flower base
turtle.fillcolor("pink")
turtle.begin_fill()
turtle.circle(10, 180)
turtle.circle(25, 110)
turtle.left(50)
turtle.circle(60, 45)
turtle.circle(20, 170)
turtle.right(24)
turtle.fd(30)
turtle.left(10)
turtle.circle(30, 110)
turtle.fd(20)
turtle.left(40)
turtle.circle(90, 70)
turtle.circle(30, 150)
turtle.right(30)
turtle.fd(15)
turtle.circle(80, 90)
turtle.left(15)
turtle.fd(45)
turtle.right(165)
turtle.fd(20)
turtle.left(155)
turtle.circle(150, 80)
turtle.left(50)
turtle.circle(150, 90)
turtle.end_fill()
# Petal 1
turtle.left(150)
turtle.circle(-90, 70)
turtle.left(20)
turtle.circle(75, 105)
turtle.setheading(60)
turtle.circle(80, 98)
turtle.circle(-90, 40)
# Petal 2
turtle.left(180)
turtle.circle(90, 40)
turtle.circle(-80, 98)
turtle.setheading(-83)Step 4: Draw Leaves Of The Flower
Next, let’s create the leaves of the flower.
Here’s the code:
# Leaves 1
turtle.fd(30)
turtle.left(90)
turtle.fd(25)
turtle.left(45)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(-80, 90)
turtle.right(90)
turtle.circle(-80, 90)
turtle.end_fill()
turtle.right(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(85)
turtle.left(90)
turtle.fd(80)
# Leaves 2
turtle.right(90)
turtle.right(45)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(80, 90)
turtle.left(90)
turtle.circle(80, 90)
turtle.end_fill()
turtle.left(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(60)
turtle.right(90)
turtle.circle(200, 60)
turtle.done()Complete Source Code On How To Draw A Flower
Here’s the complete source code on how to draw a flower:
import turtle
# Set initial position
turtle.penup()
turtle.left(90)
turtle.fd(200)
turtle.pendown()
turtle.right(90)
# flower base
turtle.fillcolor("pink")
turtle.begin_fill()
turtle.circle(10, 180)
turtle.circle(25, 110)
turtle.left(50)
turtle.circle(60, 45)
turtle.circle(20, 170)
turtle.right(24)
turtle.fd(30)
turtle.left(10)
turtle.circle(30, 110)
turtle.fd(20)
turtle.left(40)
turtle.circle(90, 70)
turtle.circle(30, 150)
turtle.right(30)
turtle.fd(15)
turtle.circle(80, 90)
turtle.left(15)
turtle.fd(45)
turtle.right(165)
turtle.fd(20)
turtle.left(155)
turtle.circle(150, 80)
turtle.left(50)
turtle.circle(150, 90)
turtle.end_fill()
# Petal 1
turtle.left(150)
turtle.circle(-90, 70)
turtle.left(20)
turtle.circle(75, 105)
turtle.setheading(60)
turtle.circle(80, 98)
turtle.circle(-90, 40)
# Petal 2
turtle.left(180)
turtle.circle(90, 40)
turtle.circle(-80, 98)
turtle.setheading(-83)
# Leaves 1
turtle.fd(30)
turtle.left(90)
turtle.fd(25)
turtle.left(45)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(-80, 90)
turtle.right(90)
turtle.circle(-80, 90)
turtle.end_fill()
turtle.right(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(85)
turtle.left(90)
turtle.fd(80)
# Leaves 2
turtle.right(90)
turtle.right(45)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(80, 90)
turtle.left(90)
turtle.circle(80, 90)
turtle.end_fill()
turtle.left(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(60)
turtle.right(90)
turtle.circle(200, 60)
turtle.done()Conclusion
We have completely discussed a step-by-step process on How To Draw A Flower with Source Codes For Free. I hope this Python Turtle tutorial will help you a lot!
Recommendation
- If you want to learn and developed different python games. I have here the list of pygame tutorials with source code for free.
- Also, If you want to enhance your knowledge of python programming. I have here the list of Python tutorials for beginners.
Customize your turtle flower drawing
Once the basic flower drawing works, experiment with these variations to make it uniquely yours or adapt it to a bigger project.
- Change petal count. Modify the loop range to draw 6, 8, 12, or 16 petals. More petals produce denser sunflower-like results; fewer petals give a cleaner geometric look.
- Swap petal shapes. Replace the circle petal with an ellipse, teardrop, or heart to get roses, tulips, or stylized flowers. Use turtle.begin_fill() and end_fill() with different pen colors.
- Randomize colors. Import Python’s random module and use random.choice() over a color list. Every flower drawn will have a slightly different palette.
- Draw multiple flowers. Wrap the flower-drawing function in another loop with turtle.penup() and goto() to draw a field of flowers.
- Save the output as an image. Use turtle.getscreen().getcanvas().postscript(file=”flower.eps”) then convert to PNG with Pillow for social media sharing.
Turtle graphics essentials for beginners
Turtle is Python’s built-in beginner graphics library. It ships with every Python installation and requires no external dependencies, making it perfect for BSIT capstone starter projects.
- The turtle metaphor. Imagine a small turtle holding a pen. When it moves, the pen draws a line. Every drawing is a sequence of movements.
- Key commands. forward(n) moves n pixels forward. left(deg) and right(deg) rotate. penup() lifts the pen so the turtle moves without drawing. pendown() puts it back.
- Colors and thickness. pencolor(“red”), fillcolor(“yellow”), pensize(3), and begin_fill() / end_fill() for filled shapes.
- Speed control. turtle.speed(0) for instant drawing, turtle.speed(10) for fast, turtle.speed(1) for slow visible drawing (great for demos).
- Screen size. turtle.setup(width=800, height=600) sets a specific window size before you start drawing.
Using this project for BSIT capstone
Turtle-based drawing projects work well as introductory BSIT capstone components. Reviewers respect the visual output because it demonstrates loops, conditionals, and function decomposition.
Extend this flower project into a more complete capstone by adding: a menu system (Tkinter) that lets users pick flower type; export functionality (save as PNG); animation (draw the flower petal by petal with a delay); and a random garden generator that draws 20 flowers with random positions and colors. Any one of these turns a small script into a substantial capstone deliverable.
Document your project with a proper README explaining the algorithm, screenshots of sample outputs, and a “future enhancements” section outlining what could come next. This documentation quality is what separates passing capstones from top-scoring ones.
Official documentation
Quick step-by-step summary (click to expand)
- Import turtle. At the top of a new Python file, write import turtle to load Python’s built-in graphics library.
- Set up the screen. Call turtle.setup(width=600, height=600) and pick a background color with turtle.bgcolor(“black”) to make petals pop.
- Draw one petal. Use turtle.begin_fill(), turtle.circle(80), and turtle.end_fill() to draw and color a single petal. Turn the turtle 60 degrees before the next one.
- Loop to draw all petals. Wrap the petal code in a for loop that runs 6 times, rotating 60 degrees between petals to form a full flower.
- Add the stem. Lift the pen, move to the flower’s center, then draw a green vertical line down to the bottom of the screen as the stem.
Frequently Asked Questions
How does the Turtle-based flower drawing program work?
It uses Python’s built-in turtle module (no Pygame needed) to draw geometric flower patterns. The turtle moves and turns in mathematical patterns, drawing arcs and circles to form petals. Color cycles per petal using turtle.color() with HSV-converted RGB values. Repeat the petal-drawing function 6, 8, or 12 times for different flower types. Great teaching project for loops, recursion, and procedural art.
What Python version do I need to run this game?
Python 3.8 or newer works. We recommend Python 3.11 or 3.12 because Pygame ships pre-built wheels for those versions (faster pip install, no compilation errors). Python 3.13 may need a slightly older Pygame release because some wheels lag the latest CPython. Verify your version with python –version on Windows or python3 –version on Mac/Linux.
How do I install Pygame for this project?
Run pip install pygame in your terminal (Windows: open Command Prompt, Mac/Linux: open Terminal). On Windows, if pip is not recognized, try python -m pip install pygame instead. On Linux, you may need sudo apt install python3-pygame if pip fails. Verify with python -c “import pygame; print(pygame.version.ver)”.
Can I use this Python game as my BSIT capstone project?
On its own, no, most Philippine BSIT panels expect a full system with users, data, reports, and a real-world problem. A single Pygame game is too narrow for capstone scope. BUT, you can use this game as ONE module inside a larger capstone (e.g. a gamified learning system, a math practice tool for elementary students with this game as the reward layer, or an arcade-style POS for an internet cafe). Pair the game with a Django backend, a database, and analytics for a defensible capstone.
Can I package this game as a standalone .exe to distribute?
Yes, use PyInstaller. Run pip install pyinstaller then pyinstaller –onefile –windowed your_game.py from the project folder. PyInstaller bundles Python and Pygame into a single .exe (Windows) or .app (Mac) that runs without Python installed on the target machine. Include asset files (images, sounds) with –add-data “assets;assets”. Output goes to the dist/ folder.
Where do I get help if the game does not run?
Check the top 3 most common failures: (1) Pygame is not installed correctly, re-run pip install pygame. (2) The game cannot find an asset file (image/sound), make sure you run python from the project folder so relative paths resolve. (3) Wrong Python version, this code expects Python 3.8+; older Python 2.x or 3.6 raises syntax errors. If you still hit a wall, drop a comment on this article with the exact error message, our team monitors comments daily.
Inquiries
By the way, If you have any questions or suggestions about this Python Turtle tutorial, please feel free to comment below.
