Text & Numbers

A track of P40 · Data & Types Basics.

Numbers, text, true/false and variables — each met through examples from a language professional's day.

Before a notebook can automate anything for you, you and it need a shared vocabulary for single pieces of material: this is a number, this is text, this is the answer to a yes-or-no question. This track builds that vocabulary one piece at a time, always starting from something you already do on paper — adding two word counts, tidying a quoted phrase, checking whether a document is over its page limit.

Here is a puzzle you can already half-solve. You know that 2 + 2 gives 4. You will learn in the second module that "abra" + "cadabra" glues two pieces of text into one word — + joins text the way you would join two halves of a split name. So now the trick question: what does "2" + "2" give — with the quotation marks? Is it 4, or is it "22", or is it an error? The answer falls straight out of the one idea this track exists to plant: those quotation marks are not decoration, they change what kind of thing the machine believes it is holding. Guess now, then let the notebook settle it.

Four short modules, one idea each. Numbers and the arithmetic you already trust — summing the word counts of three chapters, without the slip. Text — what code calls strings — and the small moves for joining, shouting, quieting, and measuring it: .upper() for a heading, len() to count the characters in a title. True/false values, which are how a notebook answers questions like "is this chapter over its limit?" — you write the comparison once and the answer comes back as a plain yes or no. And variables: the simple act of giving a value a name, so you can set word_limit = 3000 at the top and use it in every line that follows.

None of this needs mathematics beyond the sums you already do in the margin of a manuscript. What it needs is exactly what your profession trains: attention to what kind of thing each mark on the page is. By the end of the track the four shapes — number, string, true/false, named value — are as ordinary to you as noun and verb, and each module closes the same way: with the notebook doing the paper version of the task faster than you could reach for a calculator.

Numberssums you already doTextjoining and cleaning phrasesTrue / falseanswers to yes-no questionsVariablesgive a value a name
Four modules, four shapes - each met through a language professional's material.