Python | Arithmetic Operators

Arithmetic operators perform basic mathematical operations. The Arithmetic operators are:

  • Addition +
  • Subtraction -
  • Multiplication *
  • Division /
  • Modulus %
  • Exponent **
  • Floor Division //

The Addition + operator adds together the value of the operands.

4 + 3 = 7

The Subtraction - operator subtracts the value of the right operand from the value of the left operand.

4 – 3 = 1

The Multiplication * operator multiplies the value of the operands.

4 * 3 = 12

The Division / operator divides the value of the left operand by the value of the right operand.

4 / 3 = 1.3333

The Modulus % operator divides the value of the left operand by the value of the right operand then returns the reminder.

4 % 3 = 1

The Exponent ** operator perform exponential calculations.

4 ** 3 = 64

The Floor Division // operator performs a division then throws away the reminder.

4 // 3 = 1

In Python, the order of operations is based on PEDMAS (parenthesis, exponents, multiplication, division, addition, and subtraction).

Leave a Reply