Colab in ten minutes
Colab is a Python notebook that runs on Google's computers, in your browser, for free. It matters here because it removes every setup problem that stops people before they begin: nothing installs, nothing conflicts, and if you break it entirely you get a fresh one by reloading the page.
Cells
A notebook is a stack of cells. Each holds a bit of code. You run one by clicking it and pressing Shift+Enter, and its output appears underneath.
Make a new notebook, click the first cell, and type:
print("hello")
2 + 2Shift+Enter. You will see:
hello
4Two things just happened that are worth naming. print displayed something. And the last expression in a cell shows its value automatically — which is why 4 appeared without a print. That second behaviour is a notebook convenience and it is why the code in this course often ends with a bare variable name: it is the fastest way to look at something.
The runtime, and the one confusing thing
Behind your notebook is a runtime — a Python session on a Google machine. It remembers everything you have run, in the order you ran it.
This is the source of the only genuinely confusing thing about notebooks: cells share state regardless of where they sit on the page. If you define something in cell 5 and then edit and re-run cell 2, cell 2 can use it. If you delete cell 5, the thing it defined is still in memory until the runtime restarts.
Which produces the classic notebook bug: your code works, you share it, and it fails for someone else — because it depended on something you ran and then deleted.
The fix is a habit. When something behaves inexplicably, Runtime → Restart session, then run your cells from the top. This is the notebook equivalent of turning it off and on again and it is correct more often than it should be.
The runtime also disconnects after a period of inactivity and everything in memory is lost. Your code is saved; the values are not. Re-run from the top and continue.
Variables and f-strings, which is most of the Python you need
name = "Priya"
minutes = 45
print(f"{name} ran a {minutes} minute meeting")Priya ran a 45 minute meetingThe f before the quote makes it an f-string: anything in { } is evaluated and inserted. This is how every prompt in this course gets built — a fixed template with your variable content dropped in — so it is worth two minutes of playing with.
Lists and loops
files = ["monday.txt", "tuesday.txt", "wednesday.txt"]
for f in files:
print("processing", f)processing monday.txt
processing tuesday.txt
processing wednesday.txtThe indentation is not style — it is how Python knows what is inside the loop. Get it wrong and you get IndentationError, which is one of the friendliest errors you will meet.
That loop is the whole of lesson 6. Forty transcripts instead of three filenames, and a model call instead of a print.
Two things that will save you an hour
Installing something uses a line starting with !, which means "run this as a terminal command":
!pip install anthropicYou will need this exactly once, in the next lesson.
Errors are long and the useful part is at the bottom. A Python error prints a traceback — the chain of calls that led to the problem — and beginners read from the top and despair. Read the last two lines first. They name the error and the line. Lesson 9 is entirely this.
Save your work
File → Save a copy in Drive, now, before you have anything worth losing. Colab autosaves to Drive after that.
Do this today: make a notebook and run all four snippets above. Then deliberately break one — remove an indent, misspell print — and read the error. Meeting your first traceback while nothing is at stake is genuinely worth doing on purpose.