# Integer or Int

## Description

* Whole number
* Used for counting
* Used for arrays indices (rows of data)

**Examples:**

_Processing:_

```java
int count = 0;
```

_JavaScript:_

```javascript
var highScore = 15350;
```

_Python:_

```python
score = 250
```

{% hint style="warning" %}
Do not use commas in your numbers!
{% endhint %}

## Shortcuts (Assignment Operators)

### Quick Math

+= means “add this”

-= means “subtract this”

\*= means “multiply it by this”

/= means “divide it by this”

{% hint style="warning" %}
This updates the variable when used
{% endhint %}

**Example:** &#x20;

_Processing, Java-based, and C-based:_ &#x20;

```java
int count = 2;

println(count);        // Prints "2"

count += 3;

println(count);        // Prints "5"
```

_Python:_ &#x20;

```python
count = 2

print(count)        # Prints "2"

count += 3

print(count)        # Prints "5"
```

### Adding or Subtracting 1

**variableName++** means “add 1” or variableName += 1

**variableName--** means “subtract 1” or variableName -= 1

{% hint style="warning" %}
This updates the variable when used
{% endhint %}

**Examples:**

_Processing, Java-based, and C-based:_

```java
float count = 0;

println(count);        // Prints "0"

count++;

println(count);        // Prints "1"
```

```java
float health = 10;

println(health);        // Prints "10"

health--;

println(health);        // Prints "9"
```

{% hint style="warning" %}
This ++ shortcut after the variable name does not work in python.&#x20;
{% endhint %}

