Thursday, July 2, 2026
HomeLanguagesturtle.filling() function in Python

turtle.filling() function in Python

The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.

turtle.filling()

This function is used to return fillstate (True if filling, False else). It doesn’t require any argument.

Syntax :

turtle.filling()

Below is the implementation of the above method with some examples :

Example 1: Default value

Python3




# import package
import turtle
  
# check the default 
# filling state
print(turtle.filling())


Output :

False

Example 2: Inside fill

Python3




# import package
import turtle
  
# begin the fill and check
# the filling state
turtle.begin_fill()
print(turtle.filling())


Output :

True

Example 3: After fill

Python3




# import package
import turtle
  
# begin fill, do something and
# end fill then check filling state
turtle.begin_fill()
turtle.end_fill()
print(turtle.filling())


Output :

False

Here we get that we can check the filling state anywhere in the program and get True only inside the fill statements ie; either after the begin_fill() method or in between the begin_fill() and end_fill() methods.

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

1 COMMENT

Most Popular

Dominic
32518 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6900 POSTS0 COMMENTS
Nicole Veronica
12014 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12110 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6966 POSTS0 COMMENTS