As a Python developer with over a decade of experience, I have always found the Turtle module to be a fantastic way to introduce programming concepts visually. Drawing lines with Python Turtle is one of the simplest yet most effective ways to get started with graphics programming.
In this article, I’ll walk you through multiple simple methods to draw lines using Python Turtle. These methods are practical, easy to understand, and you can use them right away in your projects.
Let’s start..!
What is Python Turtle?
Before diving in, let me quickly explain what Python Turtle is. Turtle is a built-in Python library that allows you to create pictures and shapes by controlling a cursor (the “turtle”) on the screen. It’s like giving instructions to a pen to move around and draw.
This module is particularly useful for teaching programming concepts to beginners because it provides immediate visual feedback. Plus, it’s fun!
Method 1: Draw a Simple Line Using forward()
The most basic way to draw a line in Python Turtle is by moving the turtle forward.
Here’s how I usually start:
import turtle
# Set up the screen
screen = turtle.Screen()
screen.title("Draw a Simple Line")
# Create a turtle object
pen = turtle.Turtle()
# Draw a line 100 pixels long
pen.forward(100)
# Finish
turtle.done()I executed the above example code and added the screenshot below.

How this works:
pen.forward(100)moves the turtle forward by 100 pixels, drawing a line as it moves.- The starting position is (0,0) by default, pointing to the right (east).
This method is perfect when you want a straight horizontal line. You can also change the direction before moving forward.
Method 2: Draw a Line Between Two Points Using goto()
Sometimes, you want to draw a line between two specific points. For example, connecting two cities on a map of the USA.
Here’s a method I use often:
import turtle
screen = turtle.Screen()
screen.title("Draw Line Between Two Points")
pen = turtle.Turtle()
# Starting point (e.g., New York coordinates on screen)
pen.penup()
pen.goto(-100, 50)
pen.pendown()
# Ending point (e.g., Los Angeles coordinates on screen)
pen.goto(100, -50)
turtle.done()I executed the above example code and added the screenshot below.

Explanation:
pen.penup()lifts the pen so it doesn’t draw while moving to the start point.pen.goto(x, y)moves the turtle to the specified coordinates.- After
pendown(), moving to the second point draws a line connecting the two points.
This method is great when you want precise control over where your line starts and ends.
Read Draw a Shape in Python Using Turtle
Method 3: Draw Multiple Connected Lines (Polyline)
If you want to draw a series of connected lines, such as plotting a route across multiple cities, you can chain several goto() commands.
Example:
import turtle
screen = turtle.Screen()
screen.title("Draw Polyline Example")
pen = turtle.Turtle()
# Coordinates for a few cities (fictional screen points)
cities = [(-150, 100), (-50, 50), (0, 0), (50, -50), (150, -100)]
pen.penup()
pen.goto(cities[0])
pen.pendown()
for city in cities[1:]:
pen.goto(city)
turtle.done()I executed the above example code and added the screenshot below.

This draws connected lines between the points, which is useful for visualizing paths or routes.
Check out Create a Snake Game in Python Using Turtle
Method 4: Customize Line Appearance
Drawing a line is more impactful when you can customize its color, thickness, and style. Here’s how I customize lines in Turtle:
import turtle
screen = turtle.Screen()
screen.title("Customized Line")
pen = turtle.Turtle()
# Set line color and thickness
pen.pensize(5)
pen.pencolor("blue")
# Draw a line
pen.forward(150)
turtle.done()You can use any color name or hex code. Adjusting pensize() changes the thickness, making your lines stand out.
Read Attach an Image in Turtle Python
Method 5: Draw Lines with Angles
To draw lines at different angles, you can use the left() or right() methods to turn the turtle before moving forward.
Example:
import turtle
screen = turtle.Screen()
screen.title("Line with Angles")
pen = turtle.Turtle()
# Draw first line
pen.forward(100)
# Turn 45 degrees to the left
pen.left(45)
# Draw second line
pen.forward(100)
turtle.done()This technique is useful for creating shapes or directional lines.
Check out Python Turtle Colors + Examples
Bonus Tip: Clearing and Redrawing Lines
While working on graphics, you might want to clear the screen and redraw lines dynamically.
import turtle
import time
screen = turtle.Screen()
pen = turtle.Turtle()
pen.forward(100)
time.sleep(2)
pen.clear() # Clears the drawing but not the turtle’s position
pen.goto(0, 0)
pen.pencolor("red")
pen.forward(150)
turtle.done()This helps when you want to update your drawing without restarting the program.
Drawing lines using Python Turtle is simple but powerful. Whether you want to create simple shapes, map routes, or build complex graphics, mastering these basic commands is essential.
If you want to practice, try plotting a simple map of your favorite US cities by drawing lines connecting them using the methods above. It’s a fun way to learn and visualize Python Turtle graphics!
You may like to read other turtle-related articles:

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.