turtle.backward() 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.backward()
The turtle.backward() method is used to move the turtle backward by the value of the argument that it takes. It gives a line on moving to another position or direction with backward motion.
Syntax:
turtle.backward(distance)
The argument it takes is distance { a number (integer or float) }. So, it moves the turtle backward by the specified distance, in the opposite direction the turtle is headed. Below is the implementation of the above method with some examples :
Example 1:
Python3
import turtle
turtle.backward( 100 )
|
Output :
Example 2:
Python3
import turtle
turtle.backward( 50 )
turtle.right( 90 )
turtle.backward( 50 )
|
Output :