Imagine we’re making a game in an arcade. The player selects a character and starts playing, winning points until it ends.

How would we keep track of the player’s points within our program? Using a variable. A variable is a named value that we can access and change. Variables hold the data within our programs.

Variables are a fundamental part of programming: they enable you to track values by assigning names to them. Once we’ve made a variable, we can access and change its value throughout our program.

In this lesson, we will discuss variables, what they are used for, and how to use them.


Throughout this course we will use Blockly commands to guide Codey towards their goal. Drag the commands into the right hand box and connect them together to make a program.

For this exercise, combine the movement commands together to have Codey move onto the flag.

Codey will need to go down and to the right.
Move Right Move Down

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?