turtle.width() function in Python Last Updated : 20 Jul, 2020 Summarize Comments Improve Suggest changes Share Like Article Like 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.width() This method is used to set or return the line thickness. Set the line thickness to width or return it. If resizemode is set to "auto" and turtleshape is a polygon, that polygon is drawn with the same line thickness. If no argument is given, the current pensize is returned. Syntax : turtle.width(width=None) turtle.pensize(width=None) Note: This method has Aliases: pensize and width and requires only one argument "width -- positive number". Below is the implementation of the above method with some examples : Example 1 : Python3 # import package import turtle # forward turtle by 100 turtle.forward(100) # set turtle width to 4 turtle.width(4) # forward turtle by 100 # in right direction turtle.right(90) turtle.forward(100) Output : Example 2 : Python3 # import package import turtle # loop for pattern for i in range(15): # set turtle width turtle.width(15-i) # motion for pattern turtle.forward(50+15*i) turtle.right(90) Output : In this above example, we decrease the size of the turtle at every move so the size of the line of the outer lines is smaller than that of the inner lines. Comment More infoAdvertise with us Next Article turtle.xcor() function in Python D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Practice Tags : python Similar Reads turtle.write() function in Python turtle module in Python provides a way to create graphics and animations using Tkinter. The turtle.write() method is used to display text at the turtleâs current position on the canvas. This function helps in labeling graphics, adding instructions or displaying values dynamically. It allows both obj 3 min read turtle.window_width() 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.window_width() This function is used to return the width of the turtle windo 1 min read turtle.xcor() 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.xcor() This function is used to return the turtle's x coordinate of the curr 1 min read turtle.ycor() 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.ycor() This function is used to return the turtle's y coordinate of the curr 1 min read turtle.dot() 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.dot()This function is used to draw a circular dot with a particular size, wi 2 min read turtle.window_height() 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.window_height() This function is used to return the height of the turtle win 1 min read Like