Python Introduction
A program is a set of instructions a computer follows. Python lets us write those instructions in a readable form. You will start with tiny programs and inspect what they display.
By the end of this lesson, you can:
- Tell code apart from output
- Read instructions in order
- Write a comment and a print statement
Introduction lesson progress0%
Course progress: 0% · 0 of 8 steps completed in this module
Learn · Code tells Python what to do
Code tells Python what to do
Code is what you write. Output is what the program shows after it runs. A print statement asks Python to display a value; the quotes themselves do not appear in the output.
Pattern
print("text to display")Code
print("Hello")Output
Hello
Why it works
- print starts a display instruction.
- The parentheses contain the value to display.
- The quoted text becomes the output without its quotes.
Remember: Write code in the dark editor; read its result in the output console.
Common mistake
Not this
HelloTry this
print("Hello")Bare text is not a display instruction. Put text in quotes inside print().