Revision course

Python from Scratch

A complete Python course, from your very first line of code, through everything the GCSE boards examine in programming, to A Level recursion, data structures, algorithms, the theory of computation, how processors, operating systems and networks work, databases and the programming project, then advanced Python, simulation and machine learning, desktop applications with tkinter and games with pygame. Nearly every example runs in your browser, and every topic has a quiz and written questions.

51Topics
510Quiz questions
980Exam marks
FluencyTarget grade

Your route to Fluency

Revision works when it has an order. Follow these stages rather than opening topics at random.

1

Type it out, do not copy and paste

Typing code out is slow and that is exactly the point. You notice the colons, the indentation and the brackets, and your fingers learn the patterns. Copying teaches you nothing.

2

Break it deliberately

Once an example works, change something and predict what will happen before you run it. Being wrong is the fastest way to find out what you actually understood.

3

Build something you want to exist

A quiz about your favourite subject, a tool that does your maths homework, a game you would actually play. Motivation matters far more than the size of the project.

4

Learn to read errors, not fear them

Read the last line first, then the line number. Nine errors in ten are a missing bracket, a wrong type or a name spelled differently from where you defined it.

5

Get through OOP properly

Classes are the boundary between writing scripts and writing programs. Give this section the time it needs, because everything at A Level and beyond assumes it.

6

Finish something

A small finished project teaches you more than five abandoned big ones, because the last ten per cent is where all the real problems live.

Beginner 4 topics

Foundations

Output, variables, types, input, operators and making decisions. The bit everything else is built on.

Beginner to intermediate 4 topics

Core Programming

Repetition, text handling, lists and your own functions. After this unit you can write real programs.

Intermediate 1 topics

Real Programs

Dictionaries for structured data, files so your program remembers things, and error handling so it does not crash.

GCSE: OCR J277, AQA 8525, Edexcel 1CP2 7 topics

GCSE Computer Science in Python

Everything the three GCSE boards examine in programming, written in Python: exam pseudocode translated, arrays, records and files, subprograms, validation and testing, SQL, searching and sorting, and tracing and debugging.

Intermediate to advanced 2 topics

Object Oriented Programming

Classes, objects, encapsulation, inheritance and polymorphism. The step from scripts to software.

A Level: OCR H446, AQA 7517 3 topics

A Level: Programming Techniques

Recursion and the call stack, the functional paradigm with map, filter and reduce, and object oriented design with composition, abstract classes and UML.

A Level: OCR H446 1.4.2, AQA 7517 4 topics

A Level: Data Structures

Stacks and queues built from arrays and pointers, linked lists, hash tables, binary trees and graphs, each with its traversals and its cost, then heaps, tries and disjoint sets.

A Level: OCR H446 2.3.1, AQA 7517 4 topics

A Level: Algorithms and Complexity

Big-O notation and what makes a problem tractable, the four sorting algorithms compared with counters, the shortest path algorithms, Dijkstra's and A star, and the greedy and dynamic programming strategies.

A Level: OCR H446 1.4.1 and 1.3.2, AQA 7517 2 topics

A Level: Data and Databases

Two's complement, bitwise operations and floating point, then relational databases: normalisation, SQL with joins and grouping, and transactions.

A Level: AQA 7517 4.4, OCR H446 1.2 and 2.1 3 topics

A Level: Theory of Computation

Finite state machines and regular expressions, Backus-Naur form with a small compiler built stage by stage, and Turing machines with the limits of what any computer can do.

A Level: OCR H446 1.1 to 1.3, AQA 7517 4.7 and 4.9 4 topics

A Level: Machines, Systems and Security

A working processor with its registers and fetch-decode-execute loop, how an operating system schedules programs and what goes wrong when they share data, compression, encryption and hashing written from scratch, and networks and the web from packets up to a web server.

A Level: OCR H446 Component 03, AQA 7517 NEA 2 topics

A Level: Testing and the Project

The levels and kinds of testing, unit tests and test driven development, and how to plan, build, test and evaluate the programming project.

Advanced: beyond the exam specifications 7 topics

Advanced Python

How Python really works and how professionals use it: names, objects and memory, generators, closures and decorators, special methods, dataclasses and type hints, exceptions and logging, the standard library, and the habits of version control, testing and profiling.

Advanced 1Names, Objects and MemoryWhat a Python variable really is: a name tied to an object. Identity against equality, mutable against immutable, the default argument trap, aliases, shallow and deep copies, how arguments are passed, and how Python frees memory with reference counting and a garbage collector.Advanced 2Iterators and GeneratorsHow a for loop really works, and how to write functions that produce values one at a time with yield. Build your own iterators, write infinite generators, use generator expressions and itertools, and chain generators into a lazy pipeline that handles data of any size.Advanced 3Closures, Decorators and Context ManagersFunctions that carry memory with them, functions that wrap other functions, and the with statement that guarantees clean-up. Build a counter from a closure, write decorators for counting, validating, retrying and registering, then make your own context managers, including a database transaction that rolls back.Advanced 4Special Methods, Dataclasses and Type HintsMake your own classes behave like built-in types, with operators, len, indexing and sorting. Then use properties, class methods, dataclasses and enums to cut boilerplate, add type hints and write your own runtime checker, and finish with modern syntax: match statements, unpacking and the walrus operator.Advanced 5Exceptions, Logging and Defensive CodeHandle errors on purpose. The full try, except, else and finally statement, custom exception hierarchies, raising from another error, assertions and design by contract, the logging module with levels and handlers, and a method for reading a traceback and testing the failure paths.Advanced 6The Standard Library ToolboxPython comes with batteries included, and knowing what is in the box saves hours of work. Count with Counter, queue with deque, search with bisect, pick with heapq, parse with re, json and csv, calculate with decimal and statistics, handle files with pathlib, and build command line tools and safe database queries.Advanced 7Working Like a ProfessionalThe habits that separate a program that works from a program that lasts. Readable code with docstrings and doctests, modules and virtual environments, version control (including a small one built from scratch), measuring performance before changing anything, and shipping a command line tool with documentation.
Advanced: simulation and AI 2 topics

Modelling and Machine Learning

Simulation with random numbers, Monte Carlo sampling, epidemics, cellular automata and queues, then machine learning written with no libraries: nearest neighbours, gradient descent, a perceptron and a small neural network.

Advanced 2 topics

Applications and Games

Desktop programs with tkinter and games with pygame, each ending in a complete working project.