> For the complete documentation index, see [llms.txt](https://docs.kidscode.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kidscode.co.za/microbit-beginners/lesson-4/what-is-a-variable.md).

# Variable, what is that!!

{% hint style="info" %}

## Teachers Notes

In this lesson, you will need to explain what is a variable with a simple example of keeping score in a game.&#x20;

You will need a cup and 5 pieces of paper that will fit in the cup. Number each piece of paper from 1 to 5. You will also need a ball to play a game. You can play a quick game of soccer with the kids where you or one kid will kick the ball through the goal posts (you can make this with two chairs)

**Explanation to the Kids:**

Think of the cup as a variable. At first, the cup is always empty. This means it is zero. We will call this cup (or variable) score. This variable will keep track of how many goals is scored.

*Now* *start to play your game. Kick the ball through the goals once.*&#x20;

Then add the number one piece of paper into the cup. Now explain to the kids that you have added a value of 1 to the variable.&#x20;

*Kick the ball through the goals again.*

Then remove the paper 1 and add paper 2 to the cup. Now the score is 2.&#x20;

*Repeat this 5 times until you add the paper 5 to the cup.*

Now explain to the kids that each time you scored a goal you added 1 to the variable or changed the variable value by 1. Each time you wanted to see what the score was, you check with the value of the variable was and that gave you the score.

*Repeat the concept if the kids dont get it first time.*
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kidscode.co.za/microbit-beginners/lesson-4/what-is-a-variable.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
