turtle.left() method in Python
Last Updated :
16 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.left()
The turtle.left() method is used to change the direction of the turtle by the value of the argument that it takes. It gives the moving of the head of the turtle in a direction.
turtle.left(angle)
The argument it takes is angle { a number (integer or float) }. So, it turns turtle left by angle units. (Units are by default degrees but can be set via the degrees() and radians() functions.) Angle orientation depends on the mode.
Below is the implementation of the above method with some examples :
Example 1:
Python3
import turtle
turtle.forward( 100 )
turtle.left( 90 )
turtle.forward( 100 )
|
Output:
Example 2:
Python3
import turtle
for i in range ( 10 ):
turtle.forward( 100 + 10 * i)
turtle.left( 90 )
|
Output :
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...