Level 4

Read the List

Level 4 · Chapter 8

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Algorithms & Programming · Grades 6–8

Name variables well and work with their values.

Code 2-AP-11Read the official text

Common Core State Standards for Mathematics

Operations & Algebraic Thinking · Grade 4

Make a number pattern and explain its rule.

Code 4.OA.C.5Read the official text

The short lines are our own words. We matched this lesson to these standards ourselves; the standards' owners have not reviewed or endorsed this course.

Common Core State Standards © 2010 National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

Today you will access specific items in a list and measure its length.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-AP-11 · ISTE 1.5.c · Standards
🎯 I canaccess specific items in a list and measure its length
🧩 New blocks2 blocks
📝 New words5 words
⏱ Lesson time~35 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students often write item (0) of list — Scratch lists start at 1, not 0.
  • Students may confuse 'length of list' with 'the last item' — length is the count, not a value.

🎯 Differentiation

🐢 Struggling: Start with a 3-item list so the loop is easier to trace. Add more items only after the pattern is clear.

🚀 Advanced: Challenge students to build a loop that reads only even-indexed items by using a counter that increases by 2.

💡 During the lesson

  • Warm-UpAsk: "If I have a list of 5 names and I want to say each one, how many times does the loop need to repeat?" (5 — which is the length.) Connect repeat (length of list) to this intuition.
  • Try ItDraw the list as a numbered column on the board. Point to each slot as you trace the loop: counter = 1 → read slot 1 → counter = 2 → read slot 2 … Students need this visual trace before coding.
    Picking 0 in the third experiment is the classic "off-by-loop" bug: the index never advances. Have students predict what the Cat will say BEFORE they run it. Connect this to the Fix It section that follows.
  • PlanPoint out the separation of concerns: the setup (add items) is separate from the reading loop. This is decomposition. Ask: "Why do we delete all at the start?" to reinforce the Ch7 habit.
  • BuildStep 8 is the key insight — because the loop uses length of [list], it adjusts automatically. Ask: what would repeat (5) do with six colors? (It skips the sixth.)