Education digital-technologies year-9
Chapter 2 - Print and Run
An introduction to output and the cycle of writing, running, and checking Python code.
Chapter 2 is where the program starts visibly doing something. It focuses on getting code to run and using output as evidence that the program worked.
Chapter Navigation
Learning Intention
- use
print()to produce clear output - run code repeatedly while making small changes
- read output as feedback on program behaviour
Core Idea
When learning Python, output is your fastest feedback loop. If the output is wrong, your logic is wrong. If the output is clear, your logic is usually clearer too.
Practice Sequence
- print a heading and separator lines
- print three mission details on separate lines
- update one line and rerun to verify change
Example
print("=== EXPLORER DAILY LOG ===")
print("Mission: Forest Survey")
print("Day: 2")
print("Weather: Mild")
Checkpoint
- each output line is intentional
- no syntax errors when running
- output format is easy to read
Chapter 2: Making the console speak
EXPLORER · v1 · learning to use
print() on purposeWhere we are now
Last time, you built the smallest possible version of a mission console. It didn’t do much - but it did something important.
It ran. It printed. It proved that Python was listening to you.
In this chapter, we’re slowing down and focusing on one tool that looks simple but ends up doing a lot of heavy lifting in real programs:
It ran. It printed. It proved that Python was listening to you.
In this chapter, we’re slowing down and focusing on one tool that looks simple but ends up doing a lot of heavy lifting in real programs:
print()What
print() actually doesAt the surface level,
But that’s not its real power.
see what your program is thinking, check whether something happened, and confirm that a section of code was reached.
Later on, when programs stop behaving the way you expect,
print() shows text on the screen. But that’s not its real power.
print() is how your program talks to you while it runs. It’s how you: see what your program is thinking, check whether something happened, and confirm that a section of code was reached.
Later on, when programs stop behaving the way you expect,
print() is often the first tool you reach for.Shaping the output
Right now, your console prints a few lines - but they’re not really designed.
When you use
A good console doesn’t dump information. It presents it.
In this chapter, we’ll use
• create visual structure • separate sections clearly • make the output feel intentional
When you use
print(), you’re in control of how information appears. Spacing, separators, and line breaks all affect how readable your output is. A good console doesn’t dump information. It presents it.
In this chapter, we’ll use
print() to: • create visual structure • separate sections clearly • make the output feel intentional
EXPLORER v1 (run this)
This is the next version of your mission console.
It still doesn’t collect information yet, that comes later. What it does do is present a clear, readable screen layout.
As you read the code, notice how comments explain why each group of print statements exists.
It still doesn’t collect information yet, that comes later. What it does do is present a clear, readable screen layout.
As you read the code, notice how comments explain why each group of print statements exists.
"""
EXPLORER v1 — Chapter 2
This version focuses on output design.
The goal is to make the mission console clear and readable.
"""
# =========================
# CONSOLE HEADER
# =========================
# This section prints the title area of the console.
# Visual structure helps users understand where they are.
print("=" * 44)
print(" EXPLORER CONSOLE ")
print("=" * 44)
# =========================
# STATUS SECTION
# =========================
# This section reports the current system status.
print("System status:")
print("- Console online")
print("- Ready to receive mission data")
# =========================
# FOOTER
# =========================
# A clear ending makes the output feel finished, not cut off.
print("=" * 44)
Why this matters later
Right now, the console always prints the same thing.
Soon, parts of this output will change depending on: names, locations, numbers, choices, and conditions.
When that happens,
Learning to use
Soon, parts of this output will change depending on: names, locations, numbers, choices, and conditions.
When that happens,
print() becomes more than a display tool. It becomes how you check whether your program is doing what you think it is. Learning to use
print() well now makes everything else easier later.Tune the console
Adjust the text inside the
You might change the title, reword the status messages, or adjust the spacing.
Aim for clarity. When the program runs, the output should look deliberate and easy to read.
If you break something, look closely at quotation marks and brackets, most early errors live there.
print() statements so the console feels like it belongs to your mission. You might change the title, reword the status messages, or adjust the spacing.
Aim for clarity. When the program runs, the output should look deliberate and easy to read.
If you break something, look closely at quotation marks and brackets, most early errors live there.
Next time
In Chapter 3, the console stops being static.
We’ll teach it to remember information using variables.
We’ll teach it to remember information using variables.
Continue the journey
← Previous
Chapter X
Back to
EXPLORER Hub
Next →
Chapter X