Open In App

turtle.begin_fill() 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.begin_fill()

This method is used to call just before drawing a shape to be filled. It doesn’t take any argument.



Syntax :

turtle.begin_fill()

Below is the implementation of the above method with an example :



Example:




# importing package
import turtle
 
# set turtle position
# and color
turtle.up()
turtle.goto(0,-30)
turtle.down()
turtle.color("yellow")
 
# start fill block
turtle.begin_fill()
 
# all instruction within this
# block are filled with turtle
# color as set above
turtle.circle(60)
 
# end fill block
turtle.end_fill()
 
# hide the turtle
turtle.hideturtle()

 

 

Output :

 

 

Article Tags :