Misconception: Students think you can use the “item (any) of (list)” block in Snap! and Scratch to check for every item in a list, but this block actually returns a random item.

  • Students often try to write something like the following to check every item in a list:
      • The block above reads: "hello" = item (any) of (list)
    • This will fail most of the time because any is a random item.
  • The contains block is what students should use in order to achieve the task they are trying to complete:
    • (list) contains
      • The block above reads: (list) contains "hello"
    • This block reports whether or not the item exists in the list. If the item if found, it reports TRUE, otherwise it will report FALSE.
  • You can actually make your own version of contains!
    • Here’s one way to create contains in Snap! +is+search for+in+the+list+(list)+
script variables (position) 
set (position) to 1
repeat (length of (list))
if (search for)=(item(position)of(list))
report true
change (position) by 1
report false

More about this tip

External Source
Michael Ball and Lauren Mock at the CS NYC Tip-A-Thon