Python Programming
Start from zero, with real Python running right in your browser. Print, calculate, decide, loop and organise your code, then read files, write classes and test what you build.
- 12 modules, 75 lessons
- About 60 hours
- 12 projects and a capstone
- Module 1 is open now, and free
Aligned to the Python Institute’s PCEP and PCAP · Lessons save for offline
Module 1 is open. The other modules are being written and reviewed by our instructors, and each one opens as it’s ready.
By the end, you’ll be able to
- Explain what a program is, run Python code, and read Python's error messages to fix your own mistakes.
- Store and change data with variables, numbers, strings, lists, tuples, dictionaries and sets.
- Control a program with decisions and loops.
- Break a problem into functions with clear parameters and return values.
- Read and write files, including CSV and JSON, and handle errors with exceptions.
- Organise code into modules and packages, and use the standard library and packages from PyPI.
- Model real things with classes and objects.
- Write readable, tested Python that follows PEP 8.
- Use Python for real work: automating tasks, calling web APIs and a first look at data with pandas.
The syllabus
Tap a module to see its lessons
1Getting started with Python6 lessons · about 1 hourFree
What a program is, your first lines of Python, reading errors, variables, maths and text.
- What a program is
- Your first program: print
- Errors are messages
- Variables
- Numbers and maths
- Strings and f-strings
Project: A receipt printer for a market stall
2Making decisions6 lessons plannedComing soon
Programs that choose: comparisons, if and elif, combined conditions and user input.
- True, False and comparisons
- if, elif and else
- and, or and not
- Nested decisions
- Input from the user
- Debugging decisions
Project: A quiz that marks itself
3Loops6 lessons plannedComing soon
Do it again: for and while loops, range, break and continue, and patterns.
- Why loops
- for loops and range
- while loops
- break and continue
- Loops with conditions
- Patterns with loops
Project: A times-table and pattern printer
4Lists and tuples7 lessons plannedComing soon
Keep many values in order: lists, slicing, comprehensions, tuples and sorting.
- Lists
- Indexing and slicing
- Changing lists
- Looping over lists
- List comprehensions
- Tuples
- Sorting and searching
Project: A to-do list manager
5Functions7 lessons plannedComing soon
Break problems into named pieces with parameters, return values and tests.
- Why functions
- Parameters and return
- Default and keyword arguments
- Scope
- Functions calling functions
- Docstrings and readable code
- Testing a function
Project: A unit converter built from functions
6Dictionaries and sets6 lessons plannedComing soon
Look things up by name with dictionaries, keep unique values with sets, and read JSON.
- Dictionaries
- Looping over dictionaries
- Nested data
- Sets
- Choosing the right collection
- JSON and Python
Project: A contacts book
7Strings and text6 lessons plannedComing soon
Work with text: methods, splitting, formatting, searching and a first regular expression.
- String methods
- Splitting and joining
- Formatting output
- Searching text
- Unicode and encodings
- Regular expressions: a first look
Project: A text analyser: word counts and the longest word
8Files and errors6 lessons plannedComing soon
Read and write files and CSVs, and handle errors without crashing.
- Reading files
- Writing files
- CSV files
- Exceptions
- try, except and finally
- Raising your own errors
Project: A grade report from a CSV file
9Modules and packages6 lessons plannedComing soon
Organise code into modules, use the standard library, and install packages with pip.
- Importing modules
- The standard library
- Writing your own module
- Packages
- pip and virtual environments
- Reading documentation
Project: Your own module, used by a small app
10Objects and classes7 lessons plannedComing soon
Model real things with classes, attributes, methods and inheritance.
- Objects everywhere
- Classes and instances
- Methods
- Attributes and __init__
- Inheritance
- Special methods
- When to use classes
Project: A bank account class with deposits and withdrawals
11Writing good code6 lessons plannedComing soon
Readable, tested code: PEP 8, pytest, debugging, type hints and refactoring.
- PEP 8 and style
- Testing with pytest
- Debugging tools
- Type hints
- Refactoring
- Version control for Python
Project: Clean up and test a messy program
12Real-world Python6 lessons plannedComing soon
Python at work: dates, automation, web APIs, a first look at pandas, and command-line tools.
- Working with dates
- Automating tasks
- Calling web APIs
- Data with pandas: a first look
- Command-line programs
- Where to go next
Project: An automation script for a real chore
Some of what you’ll build
Module 5 · Coming soon
A unit converter built from functions
Module 8 · Coming soon
A grade report from a CSV file
Module 12 · Coming soon
An automation script for a real chore