Python for Data Analytics • Lesson 4
Numbers & Arithmetic
Learn how Python performs calculations using arithmetic operators, including addition, subtraction, multiplication, division, modulus, floor division and exponentiation.
0 of 8 concepts completed
Complete the activity and related MCQ to unlock the next concept.
Addition and Subtraction
The + operator adds two numbers and the - operator subtracts. Both work with numbers, with variables, and even with a mix of both — as long as the values are numeric.
Learn by Seeing
Basic addition and subtraction
10 + 5 # 15 20 - 8 # 12 a = 25 b = 15 print(a + b) # 40 print(a - b) # 10
Operators combine numeric values; the result is stored or printed.
Change the numbers and operator — see the live result:
25 + 15
= 40
Interactive Activity
What is 25 + 15?
Hint: Simple integer addition.
Python Analyst Mindset
Every calculation is an analyst's tool
Revenue, margin, growth rate, average order value, even a simple "is this divisible by 12" check — they all come down to these seven operators. Once you know them, you can express any business formula in Python.
Add / Subtract
Totals and differences.
Multiply
Line totals and revenue.
Divide
Averages and ratios.
% // **
Remainders, floor, powers.
Frequently Asked Questions
Numbers & Arithmetic — FAQs
Python's / operator always returns a float, even when the division comes out even. Use // to get an int.
% returns the remainder of division, // returns the whole number of times the divisor fits.
Not always. Precedence rules (then left-to-right for same-precedence operators) apply: ** first, then * / // %, then + -.
-4. Floor division always rounds toward negative infinity, not toward zero.
Lesson Summary
What you learned
Addition, subtraction and multiplication.
Normal division, always returns a float.
Remainder and floor division.
Exponentiation — raising to a power.
** first, then * / // %, then + -. Parentheses override.
price × quantity, total − discount, remainder checks.