Final answer:
To move the turtle in Python Turtle graphics without drawing a line, use the command penup(). It lifts the pen from the canvas so the turtle moves without leaving a mark. When ready to draw again, use pendown() to put the pen back down.
Step-by-step explanation:
To enable turtle movement without drawing a line in the Python Turtle graphics module, one should use the penup() command. This command tells the turtle to lift its pen from the drawing surface, therefore moving without leaving any trace or line behind.
Here is a step-by-step explanation:
- Import the turtle module using import turtle.
- Create a turtle object using turtle.Turtle().
- To prevent the turtle from drawing lines as it moves, invoke penup() on the turtle object.
- Now, whenever you instruct the turtle to move, for instance with forward() or goto() commands, it will move without drawing.
- If you want the turtle to start drawing again, you can use the pendown() command.
Here is an example:
import turtle
my_turtle = turtle.Turtle()
my_turtle.penup()
my_turtle.forward(100) # Moves forward without drawing
my_turtle.pendown() # The turtle will draw lines again