# Assignment

> The step that puts a value in a variable. Most languages use one = sign.

**Field:** Software Development  
**Category:** Programming Concepts  
**Also known as:** Variable Assignment, Assignment Statement

## Think of it like

Think of it like a label you stick on a jar of jam.

## Definition

Assignment is the step that puts a value into a variable. In most languages it uses a single equals sign, like age = 12. The right side is worked out first, then stored under the name on the left. So count = count + 1 makes sense: take the old count, add one, store it back. The equals sign here means store, not is equal to.

## Example

Lucy writes total = 5 + 3. Python works out 8, then stores 8 under the name total.

## Example code

```python
>>> count = 1
>>> count = count + 1
>>> count
2
```

The right side is worked out first, then stored back in count.

## Why it matters

Every variable gets its value through assignment. Reading = as store makes lines like count = count + 1 clear.

## Common mistake

Using one = to compare two values. Most languages use == for that, and mixing them up is a classic bug.

## Three principles

- **Right side first.** The value is worked out, then stored.
- **Store, not equal.** One = sign means put this in that box.
- **Replaces the old.** The new value takes the old one's place.

## Related terms

- [Variable](https://learn.benibix.com/term/development/variable)
- [Constant](https://learn.benibix.com/term/development/constant)
- [Expression](https://learn.benibix.com/term/development/expression)
- [Comparison Operator](https://learn.benibix.com/term/development/comparison-operator)

## Taught in

- [Variables and Assignment](https://learn.benibix.com/learn/development-concepts/variables-and-assignment): Programming Basics, 5/18

---

Source: https://learn.benibix.com/term/development/assignment
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
