Lesson 12: Making Patterns with Turtle
Topics Covered:
- Using loops to create repeated shapes
- Combining movements for patterns
- Changing colors and pen size
Using Loops for Patterns
Loops make it easy to draw repeated shapes or designs.
import turtle
t = turtle.Turtle()
for _ in range(36):
t.forward(100)
t.left(170)
turtle.done()
Changing Colors and Pen Size
You can change the drawing color and pen thickness:
t.color("blue") # Change pen color
t.pensize(3) # Set pen thickness
Creating a Star Pattern
import turtle
t = turtle.Turtle()
t.color("red")
t.pensize(2)
for _ in range(5):
t.forward(100)
t.right(144)
turtle.done()
Activity: Create Your Own Pattern
- Try changing the angles and steps in the loop
- Use different colors with
t.color()
- Experiment with pen size and speed using
t.pensize()
andt.speed()
Challenge
Create a colorful flower by combining circles and loops:
import turtle
t = turtle.Turtle()
t.speed(10)
for _ in range(36):
t.circle(100)
t.left(10)
turtle.done()