19 Sep turtle.end_fill() function in Python
The turtle.end_fill() function fills the shape drawn since the last call to begin_fill(). The fill color is the one set by color() or fillcolor().
Syntax: turtle.end_fill()
Parameters: None.
Let us see an example to implement the turtle.end_fill() function in Python:
Demo29.py
# turtle.end_fill() function in Python
# Code by Studyopedia
import turtle
window = turtle.Screen()
t = turtle.Turtle()
t.fillcolor("lightblue")
t.begin_fill()
t.circle(50) # Draw a circle
t.end_fill() # Fill the circle
window.exitonclick()
The following is the output:

In the above code, we followed the below steps:
- Import the module: import turtle loads Python’s turtle graphics library.
- Create the screen: window = turtle.Screen() opens the drawing window.
- Create the turtle: t = turtle.Turtle() creates the turtle (your pen).
- Set fill color: t.fillcolor(“lightblue”) sets the interior color for filling to light blue.
- Begin filling: t.begin_fill() starts recording the path to fill.
- Draw the circle: t.circle(50) draws a full circle of radius 50 (outline uses the current pen color).
- End filling: t.end_fill() fills the circle with light blue.
- Close on click: window.exitonclick() keeps the window open until you click, then closes.
If you liked the tutorial, spread the word and share the link and our website, Studyopedia, with others.
For Videos, Join Our YouTube Channel: Join Now
Read More:
- OpenCV Tutorial
- Python Tutorial
- NumPy Tutorial
- Pandas Tutorial
- Matplotlib Tutorial
- Generative AI Tutorial
- LangChain Tutorial
- RAG Tutorial
- Machine Learning Tutorial
- Deep Learning Tutorial
- Ollama Tutorial
- Retrieval Augmented Generation (RAG) Tutorial
- Copilot Tutorial
- Gemini Tutorial
- ChatGPT Tutorial
No Comments