Search⌘ K
AI Features

Project: Creative Design

Explore how to use Python's turtle module to draw geometric shapes and art by manipulating sides, angles, and colors. Learn to apply loops for pattern creation and customize drawing attributes. This lesson helps you develop creativity and coding skills through interactive design tasks.

Task

Try changing:

  • The number of sides

  • The angle

  • The color

import turtle

pen = turtle.Turtle()

pen.color("purple")
for _ in range(6):
    pen.forward(80)
    pen.right(60)
Drawing a hexagon with custom color and angle

You’re making beautiful geometric art.

If you’re stuck, click the “Show Solution” button.

Bonus: Draw a spiral

import turtle

pen = turtle.Turtle()
    
pen.color("red")
for i in range(50):
    pen.forward(i * 5)
    pen.right(45)
Creating a spiral pattern that grows outward with each step

Try tweaking the values to create different patterns.

Quick recap

We learned:

  • How to use the turtle module to draw shapes

  • How to use loops for patterns

  • How to customize the pen’s color, speed, and thickness

What’s next?

We’ve explored code and creativity! Now let’s level up and learn how to use Python’s built-in libraries to unlock powerful tools and features.