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!
the thought
the code
Worked Example
Read the comments (in grey) to understand what the code does.
Predict
Don't run this code yet! What exactly will appear on the terminal screen?
Strategy: Check for the speech marks " ".
Live Python Lab
Experiment with code in real-time below.
🥉 Change the Message
Modify the code to print your own name instead of "Hello".
🥈 Fix the Syntax
The programmer forgot to close the speech marks. Fix the error!
🥇 The Receipt
Create the receipt design using multiple print statements.
+------------------+ | TECH STORE | | Item: Laptop | | Price: $500 | +------------------+