Labs
One session a week, 32 hours in total. Work is submitted to the grading platform, which marks it automatically and gives feedback straight away.
- Lab 1Setting Up and Running Your First ProgramInstall Python and VS Code, learn to run a .py file from the terminal, and submit once. Part B shows you chaos in ten lines — shift the starting value by one millionth and twenty-five rounds later nothing looks the same.Week 1AI Level 0
- Lab 2Characters, Bases and Floating-Point PrecisionPart A covers escapes, ord/chr, bases and two calculations. Part B digs all the way into floating point and finally answers the question Lab 1 left open — why two algebraically identical formulas give different answers. Part C is files and directories from the terminal.Week 2AI Level 0
- Lab 3Strings and Your First FunctionsPart A is seven problems on strings, formatting and functions — one built specifically to expose the print/return confusion, and one that turns Lab 2's Heron formula into a function and builds two more on top of it. Part B turns a raw line into an aligned table and runs straight into the real problem of wide characters. Part C covers running Python from a terminal, and redirection.Week 3AI Level 0
- Lab 4Control Flow in PracticePart A is seven problems combining conditions and loops; from now on every function carries type annotations. Part B computes π two entirely different ways and makes you judge them against each other. Part C is viewing and editing files from the terminal.Week 4AI Level 0
- Lab 5Lists in PracticePart A is six problems on list operations, slicing and copying, walking into three classic traps deliberately. Part B takes one class roster from parsing to ranking to dirty data, and ends by showing where lists run out. Part C is git on your own machine.Week 5AI Level 0
- Lab 6Word Counting and Choosing a ContainerSeven problems. The first five exercise one container each, the sixth is a full word-frequency task, and the last involves no code at all — pick a container for each scenario and justify it.Week 6AI Level 0
- Lab 7Recursion Workshop · Solo Project A OpensSix problems drilling the fundamentals of recursion, from simple linear cases through to backtracking. Then the brief for solo project A — the first assignment this term where you make your own design decisions.⬥ Solo assignment 1 opens · HanoiWeek 7AI Level 0
- Lab 8Linux Basics and AI Code ReviewThe first half is the Linux command line, which is what essentially every server and computing cluster runs on. The second half is code review — no writing, just finding what is wrong with someone else's code.⬥ Solo assignment 1 due · AI policy moves to Level 1Week 8AI Level 1
- Lab 9Designing and Writing ClassesSix problems. Four write classes, one refactors existing dictionary code into a class, and the last asks you to judge whether a class is warranted at all — sometimes it is not.Week 9AI Level 1
- Lab 10Inheritance, Operators and Modules · Solo Project B OpensFive problems on inheritance, special methods and module organization, then solo project B — arbitrary-precision arithmetic, where you have to build the machinery yourself.⬥ Solo assignment 2 opens · primesWeek 10AI Level 1
- Lab 11Measuring Complexity and Writing TestsSeven problems. Three measure complexity by hand, three exercise exception handling, and the last asks you to write your first pytest suite — for somebody else's code.⬥ Solo assignment 2 dueWeek 11AI Level 1
- Lab 12Processing Real Text DataThis session hands you deliberately dirty data — encoding problems, inconsistent lines, missing fields. Your job is to clean it up without crashing.⬥ Solo assignment 3 opens · big integersWeek 12AI Level 1
- Lab 13Iterators and GeneratorsSeven problems. Four write generators, one replaces boilerplate with itertools and collections, and the last two measure the memory difference and handle a realistic large-data scenario.⬥ Solo assignment 3 dueWeek 13AI Level 1
- Lab 14Functional Programming · Team Project OpensFive problems on closures, decorators and scope, then the largest piece of work this term — the team project, in pairs, building a simplified NumPy.⬥ Team project opensWeek 14AI Level 1
- Lab 15Team Project DevelopmentNo separate problems this week — the whole session is project time. But there are four milestones to reach, and TAs will check each pair against them.⬥ AI policy moves to Level 2Week 15AI Level 2