How do you move the pen forward?
Answer: forward()
The forward() function is used to move the pen forward.
The example is as follows:
Program:
#import the turtle
from turtle import *
# create a turtle space
space = Screen()
turtle = Turtle()
turtle.penup()
turtle.goto(-150,150)
turtle.pendown()
# Draw a line by forwarding the turtle
turtle.forward(300)
# Turn the turtle pointer
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(300)
Output: