Skip to Main Content

Python for Basic Data Analysis: 1.8 Arithmetic operators

Get started on your learning journey towards data science using Python. Equip yourself with practical skills in Python programming for the purpose of basic data manipulation and analysis.

Python operators 

Python operators are symbols that perform an operation on one or more operands. An operand is a variable or a value on which we perform the operation.

Arithmetic operators 

Arithmetic operators 

Python orders which operator goes first before others using PEMDAS (Parentheses, Exponentiation, Multiplication and Division, Addition and Subtraction)

 

Operator Function Example Usage Calculation Example Output
+ Addition 3 + 7 3 + 7 10
- Subtraction 3 - 7 3 - 7  -4
* Multiplication 3 * 7 3 x 7 21
** To the power of 3 ** 3 33 27
/ Division 11 / 3 11 ÷ 3 3.66666666667
// Division
(Round down)
11 // 3 round down
11 ÷ 3
3
% Modulus
(Remainder)
11 % 3 11 mod 3 2

Click the triangle button to run the codes and see the output:

Exercises

Use the operators to solve for the following equations

1. 6 + 4

2. ((27 * 2) + 46) ** 0.5

3. Find the modulus of 35 / 6