← Back to Blog

"Python Turtle Tutorial: Draw Your First Shape in 5 Minutes

"2026-11-10

If you are looking for a python turtle tutorial that gets straight to the point, you are in the right place. Python Turtle is the best way to learn programming because you can see your code working instantly on the screen.

In this tutorial, we will write a few lines of python code to draw a colorful square. You can run this code directly in your browser using our online python editor, so you do not need to install anything.

Step 1: Import the Turtle Module

The first thing you need to do is tell Python to use the turtle module. You do this by typing from turtle import * at the top of your file.

This command imports all the functions you need, like forward(), right(), and color().

Step 2: Set the Background and Color

Before you draw, you can change the background to black and the pen to cyan to make it look like a neon sign.

Python
from turtle import * bgcolor("black") color("cyan") pensize(4)

Step 3: Draw the Square with a Loop

Instead of typing forward and right four times, we use a for loop. This tells the computer to repeat the drawing steps four times.

Python
for i in range(4): forward(150) right(90) done()

See What You Can Build

Once you understand how loops and colors work, you can create stunning art. Check out this Mandala, which is built using the exact same commands you just learned.

Mandala created with python turtle tutorial code

This design uses overlapping circles and color changes to create a symmetrical piece of art.

View the Full Code

Take the Next Step

Now that you have drawn a square, try our interactive lesson on drawing a star, which teaches you how to use different angles.

Take Python Everywhere

If you want to practice Python Turtle and master Python on your phone, we highly recommend Python Play. It features a built-in Turtle graphics playground and 100 interactive levels to test your coding skills.

Python Play: Coding & Quiz App

Learn Python, solve 100 challenges, and run real Turtle graphics code directly on your phone. No setup required.

Get it on Google Play