Python Foundations
Read it before you run it
Look at a Python program and say what it prints — then write one that turns a messy export into a report you would actually show someone. You run Python on your own machine. Nothing here runs the code for you.
- Modules
- 8
- Drills
- 18
- Build steps
- 8
- Time
- ~6h
Walk out with
A program that turns a messy listening history into a report you would screenshot — and the habit of tracing first.
What you'll do
Read it, then run it
Trace Python first. Install it when ready to build.
Follow the control
Decisions, loops, and calls — on paper, to the last line.
Calls, aliases, crashes
Trace a call, a shared list, and a traceback.
Print a report
A messy export in, a chart you would screenshot out.
What you get
Skills that stick
Every project mixes short lessons, focused drills and real build steps, so you finish with working code and the judgement behind it.
You will practise
- Trace a loop to its last number
- Say which name still holds what
- Read a traceback cold
- Spot when two names share a list
Afterwards you can
- Predict what a program prints
- Fix a program from its traceback
- Write a small file-to-report program
- Design one boundary test
Modules
Step by step
Each module builds on the last. Read a short lesson, drill it until it's second nature, then put it to work.
- 1
Read a line before you write one
~46 minLook at a line and say its type, its value, and which name still holds what.
- LessonSee what a line does7 min
- LessonA name points, it is not a box9 min
- DrillEvaluate the expression8 min
- DrillName the type6 min
- DrillAfter this, who holds what8 min
- DrillWhat the string becomes8 min
- 2
Read a decision
~37 minName the branch that runs, and the operand Python never looks at.
- LessonFollow the choice7 min
- DrillWhich branch runs8 min
- LessonAnd, or, and the skipped operand8 min
- DrillWhat and/or hand back8 min
- DrillTrue or false on the page6 min
- 3
Trace a loop to its last iteration
~53 minFollow a loop on paper and be right about the number that comes out.
- LessonFollow a loop to the end11 min
- DrillThe value when it stops10 min
- DrillHow many times the body runs10 min
- DrillWhat range actually yields8 min
- LessonThe last index is len minus one6 min
- DrillOff by one at the edge8 min
- 4
Follow a call in and out
~38 minTrace a call, tell a return from a print, and resolve the right n.
- LessonWhere a call actually goes9 min
- DrillWhat the whole program prints12 min
- LessonLocal names and sticky defaults9 min
- DrillWhich n is this8 min
- 5
See the shared object
~35 minPredict when a change through one name is visible through another.
- LessonTwo names, one list10 min
- DrillLook it up8 min
- LessonOne row, used twice7 min
- DrillDoes the other name see it10 min
- 6
Read the failure
~40 minRead a traceback, pick the handler, and find where it first went wrong.
- LessonRead the red text12 min
- DrillRead a traceback10 min
- DrillWhich handler runs8 min
- Build stepFind where it first went wrong10 min
- 7
Get Python running
~34 minInstall Python and an editor, give it a folder, run a file, drill the punctuation.
- LessonPut Python on the machine8 min
- LessonAn editor and a folder6 min
- LessonRun a file, then break it10 min
- DrillThe line that will not start10 min
- 8
Build it
~1hTurn a messy export into a report you would show someone, then point it at your own data.
- LessonThe report you will build10 min
- Build stepSave the listening history4 min
- Build stepSkip the rows that are broken12 min
- Build stepMinutes for the busiest artist10 min
- Build stepDraw the bars10 min
- Build stepFour functions, one job each6 min
- Build stepDesign one boundary test8 min
- Build stepPoint it at your own data8 min
More in Languages
Keep going
Python Fluency
Choose the shape before you type. Then say it in one line.
Intermediate~5h7 modules
Python Confidence
Somebody else wrote it. Find out whether it works.
Advanced~7h7 modules
Python Craft
It works. Now make it somebody else's.
Advanced~10h7 modules
Python Design
It works. It is also the wrong shape.
Advanced~8h7 modules
Ready when you are.
Work through it at your own pace and pick up right where you left off.