# 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 %}
