Welcome to Day 1. Before we talk about what Python is, run some.
The box below is a real Python editor. Press Run — the first run takes a few seconds while Python itself downloads into your browser, and every run after that is instant.
print("Hello, Python")That is a complete Python program. One line, no boilerplate, no compiler.
There is no main(), no semicolon, no class wrapped around it — a Python file
is simply a list of instructions, run top to bottom.
What just happened
print is a function: a named piece of behaviour you can call. You call a
function by writing its name followed by parentheses, and you put the values it
should work on inside those parentheses. Those values are called arguments.
print("Hello, Python")
# ↑ ↑
# name argument
print takes whatever you give it and writes it to the output. Give it several
arguments and it prints them all, separated by spaces.
print("Hello,", "Python", "-", 7, "days")
print("one")
print("two")Notice two things. Text is wrapped in quotes; the number 7 is not. And each
print starts a new line — that is why one and two do not run together.
Strings and numbers are different things
"Hello" is a string — a piece of text. 7 is an integer. The quotes are
what make the difference, and Python takes them seriously:
print("7" + "7")
print(7 + 7)Adding two strings glues them together; adding two numbers adds them. Same symbol, different behaviour, decided entirely by what you gave it. We will come back to this on the next page — it is the source of most first-week confusion.
Break it on purpose
Delete a quote mark in the box above and press Run. Python will refuse the program and point at the line. Reading error messages early is a real skill, and you cannot break anything here — the code runs in your browser tab and nowhere else.
Comments
A line starting with # is ignored by Python. Comments are notes for humans —
for other people reading your code, and for you in three months when you have
forgotten why you wrote something.
# Work out the tip on a restaurant bill.
bill = 40
# 18% is the usual rate here.
print(bill * 0.18) # a comment can also sit after codeGood comments explain why, not what. # add 1 to x next to x = x + 1
tells the reader nothing they could not see. # skip the header row tells them
something real.
Whitespace has meaning
In most languages, indentation is decoration. In Python it is syntax — it is how Python knows which lines belong to what. You will use this properly on Day 2, but you can meet the error now:
print("first line")
print("this line is indented for no reason")IndentationError: unexpected indent. Python is telling you that an indented
line has to be inside something, and there is nothing here for it to be
inside. Remove the leading spaces and it runs.
How to use this course
A few things worth knowing before your first exercise.
Seven days is a pace, not a deadline. Each day is a module. Two hours a day is a guess at a comfortable speed; take a module over two evenings, or three, if that’s what it needs. Nothing expires.
Core and explore. A few lessons are marked Explore in the sidebar. Nothing later in the course depends on them — skip them on a first pass and you can still do every exercise and the final project. Come back when you’re curious.
Help comes in steps. Every exercise has hints before its solution: first the idea, then a first step. Open them in order, and only as far as you need. The solution is always there, and reading it is not cheating — but try the hints first, because the moment you work something out is the moment it sticks.
Predict before you run. Before an exercise you’ll often be asked what a program prints before you press Run. Commit to an answer — say it out loud, or jot it down. A wrong prediction you then correct teaches more than a right one you never had to make.
Using an AI assistant well
AI chat tools are genuinely useful for learning, and genuinely good at stopping you from learning. A routine that keeps the useful half:
- Try first, and get stuck on something specific.
- Ask for a hint or an explanation, not the finished program: “why does this loop stop early?” rather than “write this for me”.
- Check what it says. Run it. AI tools are confidently wrong often enough that “it told me so” is never the end of it.
- Close the chat and do a similar task yourself. If you can’t, you’ve borrowed the answer rather than learned it — which is fine to notice, and the reason for this step.
Before you write your own
Predict. Read this program and decide what it prints — all three lines — before you press Run.
print("Total:", 3 + 4)
print("3" + "4")
print("Day", 1, "of", 7)Check your prediction
Total: 7
34
Day 1 of 73 + 4 has no quotes, so it’s arithmetic: 7. "3" + "4" is two strings, so
+ glues them: 34. And separate arguments to print are joined with a space,
whatever their types.
Fix. This should print a three-line shopping list, but Python refuses to run it. Press Run, read the error, fix that line, and run again — there’s a second mistake behind the first.
print("Shopping list")
print("- bread")
print("- milk)Check your fix
print("Shopping list")
print("- bread")
print("- milk")Shopping list
- bread
- milkPython stops at the first problem it finds, so the second only appears once
the first is fixed: an IndentationError (line 2 has spaces it shouldn’t), and
then an unterminated string (line 3 is missing its closing quote). Fixing one
error and running again is normal — it’s how everyone works.
Print a small profile
Using only print, produce exactly this output:
Name: Ada
Role: Programmer
Years active: 8Try it in the box before opening the hints.
# Your code hereHint 1: the idea
Each line of output is one print call, and each call starts a new line. The
text goes inside quotes — including the 8, which here is just part of the
sentence you’re printing.
Hint 2: a first step
Get the first line exactly right before you do the others:
print("Name: Ada"). Run it and compare it with the target, character by
character. The next two lines follow the same pattern.
Show one solution
print("Name: Ada")
print("Role: Programmer")
print("Years active: 8")One print per line of output is the obvious approach, and obvious is good.
There is a shorter way using \n inside a single string, and a much better way
using variables — which is exactly where the next lesson starts.
What you learned
- A Python program is a list of statements, run from top to bottom.
print(...)writes values to the output; several arguments are separated by spaces.- Text goes in quotes and is called a string; numbers do not.
#starts a comment, which Python ignores.- Indentation is part of the language, not decoration.
Next up: giving your values names, so you can use them more than once.