Open In App

turtle.hideturtle() function in Python

Last Updated : 17 Jul, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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.hideturtle()

This method is used to make the turtle invisible. It’s a good idea to do this while you’re in the middle of a complicated drawing because hiding the turtle speeds up the drawing observably. This method does not require any argument.

Syntax:

turtle.hideturtle() or turtle.ht()

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

Example 1 :

Python3




# importing package
import turtle
  
# forward turtle by 100
turtle.forward(100)
  
# hide the turtle
turtle.hideturtle()


Output :

Example 2 :

Python3




# importing package
import turtle
  
# draw a circle
turtle.circle(80)
  
# hide the turtle
turtle.hideturtle()


Output :

Without hiding the turtle

Hiding the turtle


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads