Skip to content
Related Articles

Related Articles

turtle.title() function in Python
  • Last Updated : 26 Jul, 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.

turtle.title()

This function is used to set the title of turtle-window. It requires only one argument as “titlestring” a string, to appear in the titlebar of the turtle graphics window. In other words, it is a string to display the title of the turtle window. By default title of the turtle graphics window is “Python Turtle Graphics”.

Syntax :

turtle.title()

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

Example 1 :



Python3




# import package
import turtle
  
  
# make turtle object 
# and set size
sc = turtle.Screen()
sc.setup(400,300)

Output :

Example 2 :

Python3




# import package
import turtle
  
  
# make turtle object 
# and set size
sc = turtle.Screen()
sc.setup(400,300)
  
# set turtle screen title
turtle.title("Turtle Window For GFG")

Output :

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :