Integer or Int

Description

  • Whole number

  • Used for counting

  • Used for arrays indices (rows of data)

Examples:

Processing:

int count = 0;

JavaScript:

var highScore = 15350;

Python:

score = 250

Shortcuts (Assignment Operators)

Quick Math

+= means “add this”

-= means “subtract this”

*= means “multiply it by this”

/= means “divide it by this”

Example:

Processing, Java-based, and C-based:

Python:

Adding or Subtracting 1

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

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

Examples:

Processing, Java-based, and C-based:

Last updated

Was this helpful?