What is a variable Pro Preview

content picture

Variables are little boxes within the computer that store important information for us. Imagine the following situation:

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #2591
  • 26 Feb 2026

You own a bar that offers the best lemonade in town. The lemonade is stored in a small, non-transparent barrel, so one can not see how much lemonade there is inside. It is essential to always have fresh lemonade on hand. If the lemonade runs out before the next delivery, you will be without it, and your customers will be unsatisfied. If you order too early, you risk that the lemonade will not be fresh and the customers will not be satisfied again. The solution is to take a white piece of paper, which will represent your variable, and write down the amount of lemonade you have. When a customer orders a lemonade, you subtract their order and put down the new amount of lemonade. You repeat that process until you are left with lets say, 10 liters of lemonade, when you order a new barrel.

As mentioned in the above situation, the white piece of paper is a variable. It stores valuable information for us, i.e., the amount of lemonade inside the barrel. If we need to program this operation, we will have to read the number written on the paper (or in the variable), subtract the amount we have sold, and write down on the paper (or in the variable) the new amount. We do not know those values beforehand, but they do not matter. We will repeat the same action until the variable has a value less than or equal to 10.