Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Python – turtle.bye()

  • Last Updated : 17 Aug, 2020

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.


This function is used to shut the turtle graphics window. It doesn’t require any argument.

Syntax : turtle.bye()
Parameters : None
Returns : Nothing

Below is the implementation of above method with some examples :

Example 1:

# import package
import turtle 
# set turtle speed to 
# slowest for better
# understandings
# motion
# use bye() method to 
# shut the window

Output :

Example 2 :

# import package
import turtle 
# set drawing turtle speed
# loop for pattern
for i in range(12):
# As simply use of bye() here will shut the 
# turtle graphics window too fast so use 
# loops to pass the time
for i in range(2000):
  for j in range(500):
# shut the turtle graphics window

Output :

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!