> For the complete documentation index, see [llms.txt](https://docs.budgielang.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.budgielang.org/syntax/variables.md).

# Variables

Budgie allows for creating variables with the `variable` command. It requires the variable name, the type of the variable, and an optional default value.

> Untyped languages such as JavaScript will skip printing the variable type.
>
> Pythonic languages such as Python and Ruby will skip declaring variables without a default value.

```
comment line : Simple declarations
variable : foo string
variable : bar number 7

comment line : Assignments
variable : qux string foo
variable : baz number bar

comment line : Interesting values
variable : quux number infinity
variable : corge boolean true
```

In C#:

```csharp
// Simple declarations
string foo;
double bar = 7;

// Assignments
string qux = foo;
double baz = bar;

// Interesting values
double quux = double.PositiveInfinity;
bool corge = true;
```

In Python:

```python
# Simple declarations
bar = 7

# Assignments
qux = foo
baz = bar

# Interesting values
quux = inf
corge = True
```

## Types

As you saw from the interesting values above, some types such as infinity or true/false have aliases per language.

Built-in types will always be lower-case in Budgie. Uppercase types will always refer to user-defined classes.


---

# 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.budgielang.org/syntax/variables.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.
