📦 Variables: labelled boxes
Unit 1 · Think like a programmer · 9 min
A variable is a labelled box holding a value. score = 0 puts 0 in the box called score. score = score + 10 takes the old value, adds 10 and stores it back. Variables can hold numbers, text (strings) or true/false.
Words in this lesson
- variable — variable
- value — value
- string — string
Project: Make three paper “variable boxes” labelled name, age and city, drop cards in, and play a “change the value” game with a friend.