Skip to content
BENIBIX Learn

Arithmetic Operator

Development🧩 Programming ConceptsData and Variables

Also known as Math Operator

A sign that does maths with numbers: +, -, *, / and more, like %.

Think of it like

Think of it like doing sums on paper. The computer just does them fast.

Example

A shop splits 7 sweets between 3 children. 7 // 3 gives 2 each, and 7 % 3 says 1 is left over.

Why it matters

Totals, prices, scores and sizes are all worked out with these. They are the first operators anyone learns.

Definition

An arithmetic operator does maths with numbers. The main ones are + for add, - for take away, * for times and / for divide. Most languages add % for the remainder, and Python adds ** for powers. The result is a new number. Times and divide run before plus and minus.

Example code

python
>>> 7 % 3
1
>>> 2 ** 3
8
>>> 7 / 2
3.5
Remainder, power and a plain divide, each on its own line.

Common mistake

Using * for powers. In Python 2 * 3 is 6, but 2 ** 3 is 8.

Key takeaways

  1. 1
    Numbers in, number out. Each one makes a new number.
  2. 2
    Remainder is %. It gives what is left after dividing.
  3. 3
    Times before plus. Use brackets to change the order.

Learn it properly