Course Content
Week 1: Getting Started
In week 1 the basis goal is to get started with the basics.
0/2
Week 2: Variables & Data Types
Variables are containers that computer programs use to store information pertinent to what that computer program will do. Data Types are the different types of Variables and how Python uses these variables when building logic
0/2
Week 3: Making Decisions
In both computer programs and the AI world, computer programs need a way to make decisions. Booleans and Conditionals provide a way to make this happen.
0/2
learning Python Programming and also Intro to Games

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() and t.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()