- Understand the Turtle graphics coordinate system
- Use basic Turtle commands: forward(), right(), left(), goto()
- Create simple shapes using loops
- Understand functions for reusable drawing patterns
- Use penup/pendown to control drawing
- Turtle is like having a robot pen that draws on a canvas.
- We tell the turtle where to move and when to draw.
- It's similar to Scratch's "pen down" blocks, but we write code instead of drag-and-drop.
- Functions help us reuse drawing patterns (like "My Blocks" in Scratch).
- Turtle forward(50) is like "move 50 steps" in Scratch
- Turtle right(90) is like "turn right 90 degrees"
- penup/pendown is exactly like Scratch's pen up/down
- The coordinate system (0,0 is center) is the same as Scratch stage
- Review: "What is a function?" (from Week 6)
- Quick demo: Open week07.py and run it
- Observe: three squares appear in different places
- Ask: "How did the turtle get to different positions?"
Explain Turtle basics:
- Turtle screen: The canvas where we draw (has coordinates like a graph)
- Turtle object: The "robot pen" that moves and draws
- Basic moves: forward, backward, right, left
- Pen control: penup (stop drawing), pendown (start drawing)
- Positioning: goto(x, y) moves to exact coordinates
Demo these commands live:
import turtle
t = turtle.Turtle()
t.forward(100) # Move forward 100 pixels
t.right(90) # Turn right 90 degrees
t.forward(100) # Draw another lineShow coordinate system on board:
- Center is (0, 0)
- Right is positive X, left is negative X
- Up is positive Y, down is negative Y
Walk through week07.py together:
Part A: Setup (5 min)
screen = turtle.Screen() # Create the canvas
screen.title("Art Gallery") # Set window title
t = turtle.Turtle() # Create our drawing turtle
t.speed(6) # Set drawing speed (1-10)Part B: Drawing function (10 min)
def draw_square(size):
for _ in range(4): # 4 sides for a square
t.forward(size) # Draw one side
t.right(90) # Turn 90 degrees- Explain: Why range(4)? (A square has 4 sides)
- Explain: Why right(90)? (Square corners are 90 degrees)
- Ask: "What would happen if we used 60 degrees?" (It wouldn't be a square)
Part C: Using goto (10 min)
draw_square(60) # First square at center
t.penup(); t.goto(120, 0); t.pendown() # Move right without drawing
draw_square(90) # Second square- Explain: penup/pendown controls whether the turtle draws while moving
- Explain: goto(x, y) moves to exact position
- Demo: What happens without penup? (Line drawn between squares)
Task A: Run and observe
- Run the program
- Count how many squares appear
- Identify where each square is located
Task B: Modifications (student_tasks.md)
- Change square sizes
- Change goto positions to create new arrangements
- Change turtle speed
Task C: Creative challenge
- Add a 4th square in a new position
- Try drawing a triangle (3 sides, 120-degree turns)
- Experiment with different colors using t.color("blue")
Ask students to explain:
- "What does goto() do?"
- "Why do we use penup and pendown?"
- "How is the draw_square function helpful?"
- "How many degrees does the turtle turn for a square?"
-
Forgetting penup before goto
- Shows: Line drawn between shapes
- Fix: Add t.penup() before goto, t.pendown() after
-
Wrong turn angle
def draw_square(size): for _ in range(4): t.forward(size) t.right(60) # Wrong! Should be 90
- Shows: Shape isn't a square
- Fix: Use 90 degrees for square corners
-
Forgetting screen.mainloop()
- Shows: Window closes immediately
- Fix: Add screen.mainloop() at the end
-
Wrong coordinates
- Using huge numbers: goto(10000, 5000)
- Shows: Turtle goes off-screen
- Fix: Keep coordinates reasonable (-300 to 300)
- Student can run the program and see three squares
- Student can explain what goto() does
- Student can modify square sizes and positions
- Student can add a new shape to the canvas
- Student understands the difference between penup and pendown
For students who need support:
- Provide a template with goto coordinates pre-filled
- Start with just modifying sizes, not positions
- Use visual coordinate grid handout
For advanced students:
- Draw 5+ shapes in a pattern
- Create a function for triangles or hexagons
- Add colors to different shapes
- Try using turtle.circle() to add circles
- Thonny IDE installed
- week07.py file
- Optional: Printed coordinate grid for visualization
- Optional: Scratch project showing pen up/down for comparison
- Draw your initials using turtle commands
- Create a simple house (square for base, triangle for roof)
- Experiment with different shapes (triangle, pentagon, hexagon)