Your First Program: Hello, World!
Since 1972, the first program every programmer writes in every new language prints the words "Hello, World!" on the screen. It started with a Bell Labs tutorial by Brian Kernighan and became a ritual spanning 50 years. Today, you join that ritual.
Step 1: Create the file
Open VS Code. Create a new folder called python-practice (File → Open Folder → create it). Inside, create a new file:
hello.pyThe .py ending tells everyone — VS Code, Python, you — that this file contains Python code.
Step 2: Write the code
Type this exactly (yes, typing — not copy-paste):
print("Hello, World!")That's it. One line. Let's decode it anyway:
Read it out loud: *"print, with the argument 'Hello, World!'"* — and that's exactly what it does.
Step 3: Run it
Open the terminal in VS Code (Terminal → New Terminal) and run:
python hello.pyOutput:
Hello, World!That's your code, executing on your machine. Take the moment. Every programmer you've ever heard of started exactly here.
Level up: make it yours
Change the program to print three lines:
print("Hello, World!")
print("My name is Galvan")
print("I am learning Python")Run again. Notice: three prints, three lines of output, in order — top to bottom, always.
print() has a few tricks
print("A", "B", "C") # A B C — commas add spaces automatically
print("A", "B", sep="-") # A-B — sep changes the separator
print("no newline", end="") # end="" stops the line break
print("...continues here")You rarely need sep and end early on, but knowing they exist saves confusion later when output appears "on the same line mysteriously."
Your first error (on purpose — this is important)
Delete one quotation mark so the line reads:
print("Hello, World!)Run it. You'll see:
SyntaxError: unterminated string literal (detected at line 1)Do not panic. This is a good thing. Read the error slowly:
SyntaxError — the *grammar* of your code is wrongunterminated string literal — a string started but never ended (the missing quote)(detected at line 1) — where to lookNow fix the quote, run again, watch it work. That cycle — error, read, fix, run — is 80% of programming. You just did it on day one, on purpose. Every time an error scares you, remember: you chose to break this one, and you fixed it.
Common Errors & Fixes
cd to move into the folder where the file lives first.✅ Checkpoint
hello.py runs and prints three lines, in orderNext lesson: the first 🧪 Practice Session — five small challenges that lock in everything from Module 1. See you there.