skip to content
Introduction to Coding

Introduction to Variables

Variables Blocks in Scratch 3.0

Variables blocks are the blocks that hold variables and lists. The variable blocks are color-coded orange, and the list blocks are color-coded dark red. There are 5 Variables blocks and 11 list blocks in Scratch 3.0.

Variables Stack Blocks

1. Set [variable] to [value] block

  • Description: Sets the specified variable to the amount.

2. Change [variable] by [value] block

  • Description: Changes the specified variable by the amount.

3. Show variable [variable] block

  • Description: Shows the variable’s Stage Monitor.

4. Hide variable [variable] block

  • Description: Hides the variable’s Stage Monitor.

Variables Reporter Block

5. [variable] block

  • Description: Reports the variable’s value.

Conversation Example with Arun and Raj


Arun: Now let’s learn about variable blocks. These blocks are very useful for holding and manipulating data.

Raj: What are the different types of variable blocks?

Arun: Scratch 3.0 has four Variables Stack blocks and one Variables Reporter block. Let’s go through each one.

Arun: The first block is the Set [variable] to [value] block. This block sets the specified variable to the amount.

Raj: So, if I want to set my score to 0 at the beginning of a game, I can use this block.

Arun: Exactly! Next is the Change [variable] by [value] block. This block changes the specified variable by the amount.

Raj: I see, so if I want to increase the score by 1 whenever a player earns a point, I can use this block.

Arun: Yes, that’s right. The next two blocks are for showing and hiding the variable’s Stage Monitor. These are Show variable [variable] and Hide variable [variable] blocks.

Raj: So I can control when the variable is visible on the stage.

Arun: Exactly. Finally, we have the [variable] block. This block reports the variable’s value.

Raj: This block is useful for checking the value of the variable at any point in the script.

Arun: Correct! These blocks are very useful for managing data in your Scratch projects.

Raj: Thanks, Arun. This makes it easier to understand how to use variables in Scratch.

Arun: You’re welcome! Next time, we’ll learn about list blocks and how to use them in your projects.