skip to content
Introduction to Coding

Activity- Create a List

Learning About Lists with Arun and Raj

In this lesson, Arun and Raj will discuss how to create and control lists in Scratch.


Raj: How do you create a list?

Arun: To create a list, go to the “Make a List” tab in the Variables menu and click on it. It will open a dialogue box. Write the name of the list and after that, tick the checkbox in front of the created list. Here, I named the list as MyList.

Raj: A list is now displayed in the stage area.

Arun: To add items to the list, drag out the add [thing] to [list] block and click on it. This will add items to your created list.

Raj: I am writing “hi my name is Iron Man”.

Arun: Okay! Now, if you want to delete anything from the list, drag out the delete [item v] of [list] block, write the number of the item in the list you want to delete, and click on it.

Raj: I have written the number 5, that means ‘iron’. On clicking, ‘iron’ is deleted from the list.

Arun: Similarly, if you want to delete everything from the list, click on the delete all of [list] block.

Raj: The list is now empty.

Arun: Next is the insert [thing] at [1 v] of [list] block. This block adds items to your list at the specified position.

Raj: How?

Arun: Write “the” in the first blank and “5” in the second blank. Click on it.

Raj: Another item is added in the 5th place.

Arun: Correct! Next is the replace item [1 v] of [list] with [thing] block. You can replace items in the list with another item.

Raj: Okay! I will replace ‘hi’ with ‘hello’.

Arun: As you can see, in place of ‘hi’, now ‘Hello’ is displaying.

Arun: Next is the item [1 v] of [list] block, which shows what item is present at a specific place in the list.

Raj: How?

Arun: Write any number in the blank space and click on it.

Raj: Oh, it is showing what is on the 6th number.

Arun: Similarly, if you want to do the reverse, use the item # of [thing] in [list] block.

Raj: Reverse means?

Arun: If you want to know the number of a particular item in the list, write the text and you will get the index.

Raj: I have written ‘is’ and on clicking, it is showing at number 4.

Arun: Easily you can access anything from the list. Let’s move to the next block which is length of [list].

Raj: On clicking, this block shows the total length of the list.

Arun: Correct! Next is [thing] contains [list] block. Write the text, it will check if the item is present in the list.

Raj: It will give output as true or false.

Arun: Correct!

Raj: As ‘name’ is present in the list, it is showing true.

Arun: Now, to hide the list box from the stage, click on the hide list [list] block.

Raj: The list is not showing on the stage.

Arun: To show the list, click the show list [list] block.

Raj: Now the list is again displaying on the stage.

Arun: Correct! These lists are useful for managing different items present in your project. Next, we will discuss My Blocks, which allows you to create your own blocks and make your project more efficient.