# Assigning a Variable

Saying what the variable name stands for is called **assigning** the variable. When you update the value, you are assigning it a new value.

{% hint style="info" %}
It's best to give a variable an **initial** or starting value when you create it. Not all languages have a default value and some variables default to a **null** value which could create errors.
{% endhint %}

## How to Assign a Value to a Variable

* Text-based code generally uses a single equal sign (=)
* What follows the = is what is put in the variable

**Examples:**

_Processing and Java-based example:_

```java
String name = “Hope”;

float opacity = 0.5;              // Equal to 50%
```

_JavaScript example:_

```javascript
var count = 0;
```

_Python example:_

```python
count = 0
```
