Module 1 of 15 · Step 1 of 8

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
Concept 1 of 3

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

  1. print starts a display instruction.
  2. The parentheses contain the value to display.
  3. 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
Hello
Try this
print("Hello")

Bare text is not a display instruction. Put text in quotes inside print().