Index Ai Academy
Phase 0 · Tools · Python core

Numbers and arithmetic

Integers, decimals, rounding, and the math behind every metric.

About 20 minutes · Free lesson

Start this lesson

Why it matters

Machine learning is arithmetic at enormous scale. A model's prediction is a long chain of multiplications and additions, its training "loss" is a single number, and the probability, token count and dollar cost of every API call are numbers too. You already reason with rates and ratios at work; this lesson is how to make Python do it, and where its arithmetic can surprise you.

What you'll be able to do

  • Calculate with +, -, *, /, //, % and ** and predict the result
  • Control the order of a calculation with parentheses
  • Round results, and explain why 0.1 + 0.2 isn't exactly 0.3
  • Convert between text and numbers with int(), float() and str()

Before this lesson

Next in this phase: Strings and f-strings