Tutorial 1/15 The Basics

Python: Output

Master the print() command and terminal logic basics.

The Hook

Imagine you want to send a Text Message to a friend. You type the message, hit send, and it appears on their screen.

In Python, the print() command is how we send a message to the computer screen. It is like a Megaphone for your code!

1
Think
the thought
2
Output
the code

Worked Example

Read the comments (in grey) to understand what the code does.

print("Game Over")
# Show the words "Game Over"
print("Score: 100")
# Show the score points
Active Recall

Predict

Don't run this code yet! What exactly will appear on the terminal screen?

print("5 + 5")

Strategy: Check for the speech marks " ".

Live Python Lab

Experiment with code in real-time below.

main.py
Terminal Output
> SYSTEM READY_
> _
BRONZE

🥉 Change the Message

Modify the code to print your own name instead of "Hello".

> _
SILVER

🥈 Fix the Syntax

The programmer forgot to close the speech marks. Fix the error!

> _
GOLD

🥇 The Receipt

Create the receipt design using multiple print statements.

+------------------+
|  TECH STORE      |
|  Item: Laptop    |
|  Price: $500     |
+------------------+
> _