Open In App

turtle.backward() method in Python

Last Updated : 16 Jul, 2020
Comments
Improve
Suggest changes
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.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
# importing packages
import turtle


# move turtle backward with 
# distance = 100
turtle.backward(100)

Output :

Example 2:

Python3
# importing package
import turtle


# move the turtle backward by 50
turtle.backward(50)

# change the direction
turtle.right(90)

# move the turtle backward by 50 again
turtle.backward(50)

Output :


Article Tags :
Practice Tags :

Similar Reads

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy