Today you will find items in a list and check if a value exists.
1 Warm-Up
2 Predict
3 Try It
4 Plan
5 Build
6 Fix It
7 Extend
8 Math Challenge
For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-AP-11 · ISTE 1.5.c · Standards
| 🎯 I can | find items in a list and check if a value exists |
| 🧩 New blocks | 2 blocks |
| 📝 New words | 5 words |
| ⏱ Lesson time | ~35 min |
Teacher Guide
📋 Before class
⚠️ Common misconceptions
- Students think 'item # of' always returns a number — it returns 0 when the value is not in the list.
- Students may use contains when they need the position. Both check existence, but only 'item # of' gives the index.
🎯 Differentiation
🐢 Struggling: Trace one search by hand on paper: write each list item, circle the match, write its index.
🚀 Advanced: Challenge students to handle a name that appears twice in the list — what index does 'item # of' return?
💡 During the lesson
- Warm-UpAsk: "If I have a list of 100 names and I want to find 'Maria,' do I read every name one by one, or is there a smarter way?" In this chapter students use built-in list blocks. At L5 they will write their own search loop.
- Try ItPlace both blocks on the board next to each other. Ask: "Which block would you use just to check yes/no? Which block would you use to find the exact location?" Students often want to use only one — show that both together give full information.
item # oftakes a value and gives a position;item (N) ofdoes the opposite.
Picking Zara in the second experiment exposes the 0-as-sentinel pattern. Students see thatitem # ofreturns 0 for missing names — a key idea before they learn to write their own search loops at L5. - PlanAsk students to draw this flowchart by hand before opening Scratch. The IF/ELSE branch with two outcomes is the key pattern to internalize. Do the first box together, then pick and watch both pictures.
- BuildStudents who use
item # ofwithoutcontainsmay not handle the "not found" (0) case. Both approaches work — but using contains first is cleaner code. Discuss why.
Show the picture first. Ask what will happen — everyone points or says one word.
Everyone picks an answer first. Then press the flag together.
Change one thing at a time. Run it, watch, then change the next thing.
Pairs put the cards in order before anyone opens Scratch.
Students build step by step. Walk around — help with questions, not with the mouse.
Ask: what did we want, and what did it do? Let them find it.
Fast finishers pick the next tier. Everyone else finishes their build.
Work it out on paper first. Then check it on the stage.