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 ten 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, Container Choice and Git RemotesPart A combines dictionaries, sets and strings in six function tasks and one design question. Part B compares list and set lookup costs. Part C continues last week's Git work with a private remote repository.Week 6AI Level 0
- Lab 7Recursion, Josephus and Search ToolsImplement recursive functions, check a Josephus recurrence against a simulation, and process text with shell pipelines. Solo assignment 1 starts this week with ordinary and adjacent-peg Hanoi.⬥ Solo assignment 1 opens · HanoiWeek 7AI Level 0
- Lab 8Code Review and Debugging with AIPart A checks five functions against contracts, Part B develops an IPv4 review from independent tests to correction, and Part C records linting, recursive frames and command-line work. Preserve sources and observed evidence.⬥ Solo assignment 1 due · AI policy moves to Level 1Week 8AI Level 1
- Lab 9Designing and Verifying ClassesKeep the six tasks: rectangles, stacks, word counts, temperatures, a gradebook refactor, and design decisions. Specify the interface first, then verify independent state, failed updates, results, and the A/B/C learning records.Week 9AI Level 1
- Lab 10Inheritance, Protocols and Modules · Prime Counting OpensRetain shapes, accounts, Money, Deck and module organization with fixed interfaces. Verify state and imports, and start solo assignment2's five prime-counting methods. Big integers remain a later topic.⬥ 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