Printing and seeing output
P39.first-steps.02 · Audience: Guest, Language professional, IT/ML learner · Prerequisites: Run your first cell
Where next?
Later in First Steps
Go up a level
P39.first-steps.02 · Audience: Guest, Language professional, IT/ML learner · Prerequisites: Run your first cell
Later in First Steps
Go up a level
In the first module, output appeared on its own. Now you will make Python show you exactly what you want, and meet the single most important distinction in all of code: text versus numbers.
print(...) takes whatever you put between its brackets and shows
it in the output panel. Text goes inside quotes —
"Hello!" — and programmers call a piece of text a
string. A number needs no quotes —
7. The quotes are not decoration: they are how you tell Python
"this is words" rather than "this is a quantity".
Why it matters — Output is how a beginner sees that something happened. Every early lesson leans on print to make the invisible visible.
As a language professional, text is your raw material — names, sentences, glossaries. Python keeps text and numbers in separate boxes because you do different things with them: you can add two numbers, but "adding" two pieces of text glues them end to end. Getting the quotes right is how you tell Python which one you mean.
The rung prints a few examples, then asks you two things: whether quotes make something text or a number, and to write a real greeting of your own for Python to print. Use a language you teach or speak — this is your material now.
Before the notebook, a warm-up: fill the gap in each line so it shows what its
comment says. A comment starts with #: Python ignores everything after it, so
here it only tells you what the line should show.
Loading the exercise...
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.
Same three-panel workspace. Type your answers, press Run, and read the output. There is no way to get it "dangerously" wrong — a wrong guess just shows a friendly message.
Loading exercise…
Loading your notes...