> For the complete documentation index, see [llms.txt](https://www.csprinciples.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csprinciples.com/big-idea-3/3.1-variables-and-assignments.md).

# 3.1 Variables and Assignments

## Enduring Understanding

To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways.

## Learning Objective

Represent a value with a variable.

## Essential Knowledge

A variable is an abstraction inside a program that can hold a value. Each variable has associated data storage that represents one value at a time, but that value can be a list or other collection that in turn contains multiple values.

Using meaningful variable names helps with the readability of program code and understanding of what values are represented by the variables.

Some programming languages provide types to represent data, which are referenced using variables. These types include numbers, Booleans, lists, and strings.

Some values are better suited to representation using one type of datum rather than another

## Learning Objective

Determine the value of a variable as a result of an assignment.

## Essential Knowledge

The assignment operator allows a program to change the value represented by a variable.

The exam reference sheet provides the “ ” operator to use for assignment. For example,

Text:&#x20;

a <-- expression

Block:

<figure><img src="/files/Z8QC8vaKDY7oQjbfTNkD" alt=""><figcaption></figcaption></figure>

evaluates expression and then assigns a copy of the result to the variable a.

The value stored in a variable will be the most recent value assigned. For example:

a <-- 1

b <-- a

a <-- 2

display(b)

still displays 1


---

# 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://www.csprinciples.com/big-idea-3/3.1-variables-and-assignments.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.
