
Variables are like small boxes inside the computer that store important information for us. Imagine the following situation:

Variables are like small boxes inside the computer that store important information for us. Imagine the following situation:
Imagine you own a bar that serves the best lemonade in town. The lemonade is stored in a small, non-transparent barrel, so you cannot see how much is left inside.
It is important to always have fresh lemonade available. If it runs out before the next delivery, your customers will be unhappy. If you order too early, the lemonade might not be fresh, and again, customers will not be satisfied.
To solve this problem, you take a piece of paper and write down how much lemonade is left. This piece of paper represents your variable. Every time a customer orders lemonade, you subtract the amount and write down the new value. You repeat this process until you reach, for example, 10 liters - then you order a new barrel.
In this example, the piece of paper is like a variable. It stores important information - the amount of lemonade in the barrel. If we want to program this process, we read the value (from the variable), subtract the amount sold, and store the new value again.
We may not know the exact values in advance, but that is not a problem. We repeat the same steps until the variable becomes less than or equal to 10.