import turtle t = turtle.Turtle() t.backward(100) # Move turtle 100 pixels backward turtle.done()
import turtle t = turtle.Turtle() for i in range(4): t.forward(100) t.right(90) t.backward(100) # Move turtle 100 pixels backward turtle.done()This code creates a turtle object and draws a square using a for loop. After the square is drawn, the turtle moves backward by 100 pixels. The turtle module is a built-in Python library and does not require any external package installation.