← Python Crash Course

PCC·01 · Chapter record

Getting Started

Chapter 1 — how Python actually runs your code

Done

The book's own Chapter 1 spends most of its time on installing Python and a text editor per operating system — not needed here, since every demo on this site already runs in-browser. These three sessions keep the ideas that carry over: what the interpreter actually does, the two ways to run code, and how to read an error when something breaks.

1.1

The Python Interpreter

  • Every Python program starts as a plain text file saved with a .py extension — a script.
  • A program called the interpreter reads your file from the very first line to the very last and carries out each instruction immediately.
  • There's no separate "build" step the way some other languages use — whatever line the interpreter reaches is the line that runs next.
  • When it sees print followed by parentheses, it displays whatever is inside them on the screen.
  • A good editor helps with syntax highlighting — coloring function names, strings, and keywords differently — so mistakes are easier to spot before you even run the file.
interpreter
the program that reads your .py file and runs it line by line
script
a saved .py file containing a full program
syntax highlighting
an editor's way of coloring code by what each part means
Activity 1

Change the message inside print() to introduce yourself, then run it again.

▶ Hello World Runner