---
title: Variable assignment
tldr: `x=1` is an example of variable assignment.
---

In Python operator `=` is used to assign a value to a variable.
Expression to the right of the `=` operator is evaluated first,
and the result is then assigned to the variable on the left.

Which variables are assigned a value in a code below?

```python
r = 2.5
area = 3.1415 * r * r
print(area)
```

## Assignment is not equality

```
x = 1
x = x + 1
```

## Assignment operator in other programming languages

To highlight the difference between variable assignment and mathematic equation,
some other programming languages use `:=` (Pascal) or `<-` (R) as an assignment operator.

&nbsp;

```pascal
x := 1   // assignment of value 1 to variable x in Pascal
```

&nbsp;

```R
y <- 3   # assignment of value 3 to variable y in R
```
