Camp 1 · Step 2 of 23
Your first program
Write and run real Python code in your browser — and join a fifty-year tradition of first programs.
Time to write actual code. By the end of this page you'll have run your first Python program and modified it to make it your own. That's not a small thing — most people never get this far.
Hello, World!
Since the 1970s, the traditional first program prints the words Hello, World! on the screen. Yours is below — and it's live. Press Run:
The first run loads Python into your browser, so it can take a few seconds — after that it's instant.
Congratulations, you're officially a programmer. 🎉
Reading your first line
Let's slow down and look at what each piece means:
print("Hello, World!")printis a function — a named action Python knows how to do. This one means "show something on the screen."- The parentheses
(...)hand the function whatever it should work with. "Hello, World!"is a string — a piece of text. The quotes tell Python "this is text, not code."
More than one instruction
Programs run instructions top to bottom, in order. Each print produces
its own line:
Try reordering the lines and running again — the output order follows the code order, always.
What will this program print?
print("A")
print("C")
print("B")Numbers work too
print isn't limited to text. Give it math and Python calculates first,
then prints the result:
Look closely at the last line: with quotes, "7 + 3" is just text, so Python
prints it as-is. Without quotes it's a calculation. The quotes make all the
difference — a distinction we'll explore properly soon.
What does print(2 + 2) show?
What's next
You can now make Python say things. Next you'll learn the finer points of printing — combining several values, blank lines, and a few tricks that make output easier to read.