Project: Creative Design
Explore how to use Python's turtle module to draw geometric shapes and patterns by adjusting the number of sides, angles, and colors. Learn to implement loops for creating repeated designs and customize pen attributes. This lesson guides you to build creative art projects and prepares you to use Python’s libraries for more complex coding tasks.
We'll cover the following...
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)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)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.