Numbers and arithmetic
P40.text-and-numbers.01 · Audience: Guest, Language professional, IT/ML learner · Prerequisites: What an import line means
Where next?
Later in Text & Numbers
Go up a level
P40.text-and-numbers.01 · Audience: Guest, Language professional, IT/ML learner · Prerequisites: What an import line means
Later in Text & Numbers
Go up a level
Take a scrap of paper and add the words in two documents — say 120 and 85 — then work out how many pages that fills. You already do this arithmetic; you just do it by hand. This module hands the same sums to Python, the calculator you already trust — one operation at a time.
+ add and - subtract (and, next, * multiply and / divide). Adding two word counts on paper gives a whole number —120 + 85 is 205 — and Python agrees. You write the sum; Python works out the answer.Why it matters — Starting from the calculator a beginner already trusts removes the fear that code is a new kind of maths. It is the same maths — typed instead of written.
Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.
Off by default. The mentor always gets your file; this only decides whether your own copy stays here. Copies live in this browser only - they do not follow you to another device, and clearing site data removes them.
Your turn: write three small sums with +, * and
/ — the add, multiply and divide you just stepped through — then
press Run and watch Python answer.
Loading exercise…
Loading your notes...