Python programs and statements
A program uses executable statements to produce a result, such as printing a greeting.
Darius sets up a laptop at his chess club's check-in desk and types these two lines:
Line 1: print("Welcome!")
Line 2: print("Check in here.")
How do they turn into the message visitors see on the screen?
Start the lesson
5 minutes. No account needed.
What you'll learn
- A statement like print("Hello!") is one instruction Python carries out, here displaying Hello!.
- Python carries out statements in order, starting at the top line and moving down.
- Each print statement adds a new line to the output, without its quotation marks, and never replaces the line before.
- Typing a program shows nothing until you select Run, and then its output appears in the output area.