How does a robot keep track of information? How can a game remember a player's score? And what happens when that information changes while a program is running?
These questions introduce students to one of the essential concepts in computer science: variables.
Learning about variables in programming helps students understand how computers store information, update values and use data to make programs work. With the right combination of coding activities and hands-on learning resources, students can explore these concepts beyond textbooks and theory.
Understanding Variables Through Real-World Examples
A variable is a named space in a program used to store information. The information can be accessed and updated whenever the program needs it.
Think about a simple robot challenge where students earn points every time their robot completes a task. The program could begin with:
score = 0After completing the first task:
score = 10After completing another task, the score can increase to 20. The variable named score stores the current value. Although the name stays the same, the information inside it changes as the program progresses. This helps students understand that programs need a way to remember and work with changing information.
What Can Students Explore When Learning Variables?
Understanding variables opens the door to several important programming skills:
- Storing information: Students discover how programs keep track of numbers, scores and other information.
- Updating values: They learn how instructions can change stored information depending on what happens during a program.
- Using data in programs: Students explore how stored information can influence subsequent instructions and program outcomes.
- Logical thinking: They begin understanding how information, instructions and results are connected.
These concepts create a foundation for exploring more advanced programming topics, including conditionals, loops and functions.
Bring Programming Concepts to Life with LEGO® Education
For students, understanding an abstract programming concept becomes easier when they can experiment with it. This is where hands-on Computer Science learning can make a difference.
With LEGO® Education Computer Science & AI kits, students combine physical building with block-based coding to explore programming concepts through structured learning experiences. Instead of only reading about how programs store information, students can build models, explore coding instructions, test different approaches and observe how their programs respond.
Educators can use these practical experiences to introduce variables in the context of a challenge—for example, tracking a score, counting completed actions or changing a value based on what a model does. Students can then test their ideas, review the results and refine their instructions.
Choosing a Computer Science Kit for Your Classroom
When selecting a learning solution, consider the students' grade level, the programming concepts you want to introduce and the type of classroom activities you plan to deliver.
LEGO® Education Computer Science & AI Kit 3–5 (45521) is designed for Grades 3–5 and can support students as they explore foundational Computer Science and AI concepts through collaborative building and coding activities.
LEGO® Education Computer Science & AI Kit 6–8 (45522) is designed for Grades 6–8 and supports progression into a broader range of programming concepts, including variables, conditionals, loops and functions.
Explore the kit details, included components and learning resources on the relevant product pages before choosing the option that best fits your classroom.
Help Students Move Beyond Basic Coding
Learning programming is not just about entering commands or making a robot move. It is about understanding how information is organised, how instructions work together and how different inputs can influence outcomes.
Variables are an important part of that journey. By combining coding with practical learning experiences, educators can help students develop programming knowledge, computational thinking and problem-solving skills.
Explore LEGO® Education Computer Science & AI kits at Knowledge Hub Shop and bring meaningful coding experiences into your classroom.













































