Foundations Free Course

Python for Case Files: Learn Python by Solving Small Real Jobs

A free, gentle start in Python for people who want to be effective in the case-file labs of every other course. Learn variables, lists, dictionaries, loops, conditions, functions, files, sorting, text and dates by solving nine small jobs for a courier company, in your browser with nothing to install: total and average the weights of parcels, clean a sign-up sheet with a set, count by depot with a dictionary, mark late deliveries at the exact edges, price orders with a function, read a messy ledger export, rank a tied table, clean phone numbers and finish with a first audit that can say ok. The data is generated for you alone, and every function you write is also tested on hidden data, so that you meet the edge cases from the first lesson.

4-6 hours of study Builds toward: beginner 9 modules

Practise on your own computer

The labs in the lessons run in your browser. To repeat them, go further and try the capstone on your own machine, set up the environment with these free guides:

Most courses on this site include case files: small jobs where you write a little Python that reads some data and works out an answer, which is then checked on data that you cannot see. They teach the rules and the edge cases of real systems, and they are much easier when you already write Python without fear.

Python for Case Files is the free on-ramp. It does not try to teach all of Python. It teaches the ten ideas that every case file uses, one at a time, by solving nine small jobs for a courier company, with data that is generated for you alone. You will not read about loops and then forget them: you will use a loop in the first lesson, a dictionary in the third, a function in the fifth, and the whole kit together in the last.

Who it is for

Technicians, administrators, students and career changers who can use a computer but have never written a program, or who tried once and stopped. You do not need to install anything: the lab runs Python in your browser (about 10 MB the first time). If you have written Python before, take the first lesson and the last one, and skip the rest if they feel easy.

What you will learn

  1. Variables, numbers and a loop: read a file, add up, find the average and the heaviest, and survive an empty day.
  2. Lists, strings and sets: clean a sign-up sheet, skip repeats, sort ignoring capitals.
  3. Dictionaries: count and total by a key, with a fair tie rule.
  4. Conditions: if, elif and else, and the exact edges where most bugs live.
  5. Functions: inputs, default values, return values and a pricing table you can trust.
  6. Files: csv, text to numbers, and numbers that cannot be read.
  7. Sorting: several keys, repeatable ties, and ranking.
  8. Text: split, join, digits only, and an explicit rule for a valid value.
  9. Dates and an audit: everything together, with an audit that can say ok.

How it works

Every lesson is a case file: a call from someone at Sabi Logistics (Halima, Emeka, Chidi and Ifeoma), a short brief that teaches the idea with small examples, a lab with a starter script, a twist and a debrief that says what an experienced person would do next. Every lab starts with a how to do this lab panel: the steps, the shape of each answer (never its value) and the first lines of your own files. A wrong answer comes with a hint, and when every answer is right you can see one good way to write it.

Each case asks the same three questions, which are the habit that this course is really teaching: what happens on empty input, what happens on an exact limit, and what happens on a tie. After you have answered them nine times, the case files of the other courses will feel familiar. You may also keep the Python primer for the case files open as a one-page reference.

When every check passes you get a case reference to submit, and a short write-up to practise explaining your work to the person who asked for it. A short capstone asks you to audit a small situation of your own, with data that you invent. There is no exam: it is a free start. The next steps are Python for Data (pandas, for analysing real tables) or any of the “in practice” courses, such as Remote Access in Practice or Electronics in Practice.