Arithmetic operators perform basic mathematical operations. The Arithmetic operators are:
- Floor Division
+ operator adds together the value of the operands.
4 + 3 = 7
- operator subtracts the value of the right operand from the value of the left operand.
4 – 3 = 1
* operator multiplies the value of the operands.
4 * 3 = 12
/ operator divides the value of the left operand by the value of the right operand.
4 / 3 = 1.3333
% operator divides the value of the left operand by the value of the right operand then returns the reminder.
4 % 3 = 1
** 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).