NEW Explore the Scratch Block Dictionary, tutorials, textbook, and classroom guides

Start learning →

length of (list) — Scratch Block Guide

📌 What you will learn

Returns how many items are currently stored in the list.

What this block does

Returns how many items are currently stored in the list.

Set repeat loop counts dynamically so adding more quiz questions works automatically.

  • Category: Variables & Lists
  • Key tip: Never hardcode a list length like "10" when "length of list" stays accurate automatically.

Working Scratch example

Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.

Example using length of (list)
  1. When green flag clicked
  2. Repeat (length of questions)
  3. Change i by 1

Try it: Loops the exact number of times needed for any list size.

Related block guides

Explore other blocks in the same category or return to the full English Block Dictionary.

Back to Variables & Lists See the overview and patterns for Variables & Lists. Learn more → Scratch Block Dictionary (All Categories) Browse Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables, and Extensions. Learn more →

FAQ

When should I use "length of (list)" in Scratch?

Set repeat loop counts dynamically so adding more quiz questions works automatically. Never hardcode a list length like "10" when "length of list" stays accurate automatically.

This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.