Python - Arithmetic Operators

6/5/2026

Arithmetic operators are special symbols used to perform mathematical operations such as addition, subtraction, multiplication, and division. The symbols that perform these operations are called operators, while the values or objects they act upon are called operands.

5operand  +operator  3operand\underbrace{5}_{\text{operand}} \; \underbrace{+}_{\text{operator}} \; \underbrace{3}_{\text{operand}}

Let's look at the example above. In the expression 5+35 + 3, the numbers 5 and 3 are the operands, while + is the operator. In this case, + is the arithmetic operator that performs addition.

All the Arithmetic Operators

Python provides seven primary arithmetic operators to handle everything from basic sums to complex powers:

  1. Addition (+): Adds two operands together.
  2. Subtraction (-): Subtracts the right operand from the left operand.
  3. Multiplication (*): Multiplies two operands.
  4. Division (/): Divides the left operand by the right operand (always returns a decimal/float).
  5. Floor Division (//): Divides the left operand by the right operand and "chops off" the decimal, returning only the whole number.
  6. Modulus (%): Divides the left operand by the right operand and returns only the remainder.
  7. Exponentiation (**): Raises the left operand to the power of the right operand (e.g., 2 ** 3 is 2 cubed).

Operands Definition:

Operands are simply the values or variables that an operator acts upon. In the expression 5 + 10, the numbers 5 and 10 are the operands, while the + is the operator.

The Addition Operator (+)

To perform addition in Python, simply place the + operator between two numbers (the operands). For example, 5+105 + 10 will calculate the sum, returning a new integer of 15

Mathematical Representation:

aaddend  +addition operator  baddend  =equals  ssum\underbrace{a}_{\text{addend}} \; \underbrace{+}_{\text{addition operator}} \; \underbrace{b}_{\text{addend}} \; \underbrace{=}_{\text{equals}} \; \underbrace{s}_{\text{sum}}

Addend & Sum

Addend: A number that is added to another number.

Sum: The result of an addition operation.

How it works in code:

python

The Subtraction Operator (-)

The subtraction operator calculates the difference between two numbers. It subtracts the right operand (the subtrahend) from the left operand (the minuend).

Mathematical Representation:

aminuend  subtraction operator  bsubtrahend  =equals  ddifference\underbrace{a}_{\text{minuend}} \; \underbrace{-}_{\text{subtraction operator}} \; \underbrace{b}_{\text{subtrahend}} \; \underbrace{=}_{\text{equals}} \; \underbrace{d}_{\text{difference}}

Subtrahend & Minuend

Minuend: The number from which another number is subtracted.

Subtrahend: The number that is subtracted from the minuend.

How it works in code:

python

The Multiplication Operator (*)

In Python, multiplication is represented by the asterisk (*). It calculates the product of two numbers, effectively performing repeated addition.

Mathematical Representation:

amultiplicand  ×multiplication operator  bmultiplier  =equals  pproduct\underbrace{a}_{\text{multiplicand}} \; \underbrace{\times}_{\text{multiplication operator}} \; \underbrace{b}_{\text{multiplier}} \; \underbrace{=}_{\text{equals}} \; \underbrace{p}_{\text{product}}

Multiplicand, Multiplier & Product

Multiplicand: The number that is being multiplied.

Multiplier: The number by which the multiplicand is multiplied.

Product: The result of a multiplication operation.

How it works in code:

python

The Division Operator (/)

The standard division operator calculates the quotient of two numbers. In Python, this operator always returns a decimal (a float), even if the result is a perfect whole number.

Mathematical Representation:

adividend  /division operator  bdivisor  =equals  qquotient\underbrace{a}_{\text{dividend}} \; \underbrace{/}_{\text{division operator}} \; \underbrace{b}_{\text{divisor}} \; \underbrace{=}_{\text{equals}} \; \underbrace{q}_{\text{quotient}}

Dividend, Divisor & Quotient

Dividend: The number that is being divided.

Divisor: The number by which the dividend is divided.

Quotient: The result obtained after performing the division.

How it works in code:

python

The Floor Division Operator (//)

Floor division divides two numbers but "chops off" the decimal part, rounding the result down to the nearest whole number. This is the go-to operator when you want to ensure your result remains an integer.

Mathematical Representation:

a//b=aba \mathbin{//} b = \left\lfloor \frac{a}{b} \right\rfloor

How it works in code:

python

The Modulus Operator (%)

The modulus operator is the partner to floor division. Instead of giving you the quotient, it returns the remainder left over after the division is complete.

Mathematical Representation:

adividend  %modulus operator  bdivisor  =equals  rremainder\underbrace{a}_{\text{dividend}} \; \underbrace{\%}_{\text{modulus operator}} \; \underbrace{b}_{\text{divisor}} \; \underbrace{=}_{\text{equals}} \; \underbrace{r}_{\text{remainder}}

Remainder

Remainder: The value left over after one number is divided by another and the division is not exact.

How it works in code:

python

The Exponentiation Operator (**)

The exponentiation operator raises the left operand (the base) to the power of the right operand (the exponent). It is a clean and efficient way to calculate squares, cubes, or any higher power without needing to import a math library.

Mathematical Representation:

abase  Exponentiation operator  bexponent  =equals  abpower\underbrace{a}_{\text{base}} \; \underbrace{\mathbin{**}}_{\text{Exponentiation operator}} \; \underbrace{b}_{\text{exponent}} \; \underbrace{=}_{\text{equals}} \; \underbrace{a^b}_{\text{power}}

Base, Exponent

Base: The number that is raised to a power.

Exponent (or Power): The number that specifies how many times the base is multiplied by itself.

How it works in code:

python

Operator Precedence

Operator precedence is simply the priority given to each operator, which determines the order in which they are executed. This rule is very important in order to output a consistent result for the same mathematical expression. Without these rules, a single calculation could be interpreted in multiple ways, leading to bugs and errors.

The Order of Operations

When an expression contains multiple arithmetic operators, Python does not evaluate them randomly. Instead, it follows a predefined order of operations to determine which calculations are performed first.

This order is commonly remembered using the acronyms PEMDAS (Parentheses, Exponents, Multiplication, Division, Addition, Subtraction) or BODMAS (Brackets, Orders, Division, Multiplication, Addition, Subtraction).

P / BParentheses / Brackets()E / OExponents / OrdersMD / DMMultiplication & Division,/,//,%ASAddition & Subtraction+,\begin{array}{lll} \text{P / B} & \rightarrow \text{Parentheses / Brackets} & ( ) \\ \text{E / O} & \rightarrow \text{Exponents / Orders} & ** \\ \text{MD / DM} & \rightarrow \text{Multiplication \& Division} & *, /, //, \% \\ \text{AS} & \rightarrow \text{Addition \& Subtraction} & +, - \end{array}

Python evaluates arithmetic expressions according to the following hierarchy:

  1. Parentheses () – Expressions enclosed in parentheses are evaluated first.
  2. Exponentiation ** – Powers and exponents are evaluated next.
  3. Multiplication, Division, Floor Division, and Modulus *, /, //, % – These operators have the same precedence and are evaluated from left to right.
  4. Addition and Subtraction +, - – These operators are evaluated last, also from left to right.

Summary

  • Arithmetic Operators are symbols (like +-*) used to perform mathematical operations between values called operands.
  • The Seven Operators: Python has seven primary arithmetic operators: Addition (+), Subtraction (-), Multiplication (*), Division (/), Floor Division (//), Modulus (%), and Exponentiation (**).
  • Division Nuance: Standard division (/) always returns a decimal (float), while Floor Division (//) returns a whole number by "chopping off" the remainder.
  • Operator Precedence: Python follows the PEMDAS / BODMAS rule to determine which part of a calculation to execute first.