length of (list) — Scratch Block Guide
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.
- When green flag clicked
- Repeat (length of questions)
- 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.
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.