item # of (thing) in (list) — Scratch Block Guide
Searches the list and returns the first index matching the value, or 0 if not found.
What this block does
Searches the list and returns the first index matching the value, or 0 if not found.
Look up a word’s position in a dictionary list to fetch its matching definition.
- Category: Variables & Lists
- Key tip: Instant built-in linear search without writing a loop.
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
- Say (item # of Key in bag) for 2 seconds
Try it: Shows the exact slot number of "Key" (or 0 if missing).
Related block guides
Explore other blocks in the same category or return to the full English Block Dictionary.
FAQ
When should I use "item # of (thing) in (list)" in Scratch?
Look up a word’s position in a dictionary list to fetch its matching definition. Instant built-in linear search without writing a loop.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.