Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

This course teaches you to program in Python, starting from nothing. You don’t need to have written a program before. You start by printing a line of text, and you finish with intermediate programs that you can show an employer. Python is a general-purpose language: people use it for scripts that automate work, web services, data analysis, science, and teaching.

You learn by writing code. The first modules teach values, decisions, loops, and functions, in notebooks where each answer is checked as soon as you run it. Then you work with text, lists, dictionaries, and sets. Next you write programs that run from a terminal, save your work in Git, read and write files, handle errors, and test your code with pytest. The last part covers classes, generators, decorators, context managers, databases, web APIs, and packaging.

Along the way you build three portfolio projects and publish each on GitHub: a terminal game, a tested command-line tool for weather data, and a capstone project of your own design. The course is free and self-paced, with no deadlines and no grades: 18 modules, three assignments, three self-tests, and the three projects.

Start with setting up your computer. The suggested pace lists every module and project in order.

Learning objectives

By the end of the course, you can:

Each module’s objectives serve the course objective in brackets. Every exercise, lab, assignment, and self-test question names the objectives it practices.

Part 1: First programs

Module 1: First programs [LO-1]

Module 2: Values, variables, and expressions [LO-1]

Module 3: Decisions [LO-1]

Module 4: Loops [LO-1]

Module 5: Functions [LO-1]

Part 2: Working with data

Module 6: Strings and text [LO-2]

Module 7: Lists and tuples [LO-2]

Module 8: Dictionaries and sets [LO-2]

Part 3: Building programs

Module 9: Scripts, modules, and the command line [LO-3]

Module 10: Version control with Git and GitHub [LO-3]

Module 11: Files and data formats [LO-4]

Module 12: Errors, exceptions, and debugging [LO-5]

Module 13: Testing with pytest [LO-5]

Part 4: Intermediate Python

Module 14: Classes and objects [LO-6]

Module 15: Inheritance, composition, and special methods [LO-6]

Module 16: Generators, decorators, and context managers [LO-7]

Module 17: Databases and web APIs [LO-8]

Module 18: Packaging and quality tools [LO-8]

Prerequisites

You don’t need any programming experience. You need a computer running Windows, macOS, or Linux on which you may install software, and you need to read English instructions and do arithmetic with percentages and averages. The course teaches the terminal and Git as it goes.

Self-check. If you can do all five of these, you are ready:

  1. Download a file, and find it again in a folder you chose.

  2. Create a folder, rename a file, and move the file into the folder.

  3. Install a program on your computer.

  4. Work out 15% of 80, and the average of 4, 7, and 10.

  5. Follow a numbered list of instructions, and notice when a step’s result doesn’t match what the instructions say it should be.

If you already program in another language, take Self-test 1 first, and skip the modules whose questions you answer correctly.

Suggested pace

The course is self-paced, so it has no deadlines: take as long as you need. This pace takes 23 weeks at about 7 hours a week, about 160 hours in all. Most modules take about 5.5 hours: about 2 for the reading, 2 for the lab, and 1.5 for the practice. Modules 1 and 16 take about 7. An assignment adds about 3 hours, a self-test about 2, Project 1 about 8, Project 2 about 12, and the capstone project about 22.

WeekTopicReadingThen
1First programsModule 1
2Values, variables, and expressionsModule 2
3DecisionsModule 3
4LoopsModule 4
5FunctionsModule 5PA1
6Strings and textModule 6
7Lists and tuplesModule 7
8Dictionaries and setsModule 8PA2
9Scripts, modules, and the command lineModule 9Self-test 1 (modules 1–8)
10Version control with Git and GitHubModule 10
11Project 1: a terminal gameThe Project 1 brief
12Files and data formatsModule 11
13Errors, exceptions, and debuggingModule 12
14Testing with pytestModule 13Self-test 2 (modules 1–13)
15–16Project 2: a command-line data toolThe Project 2 brief
17Classes and objectsModule 14
18Inheritance, composition, and special methodsModule 15Capstone proposal
19Generators, decorators, and context managersModule 16PA3
20Databases and web APIsModule 17Capstone milestone
21Packaging and quality toolsModule 18Self-test 3 (all modules)
22–23The capstone projectThe capstone briefCapstone release

Checking your work

The course has no grades. Instead, every piece comes with a way to check it, so you can tell what you have learned and what to review:

PieceHow you check itObjectives
Labs 1–18Every check cell in the notebook passesEach lab’s module
PA1: Numbers, decisions, and functions (notebook)Its visible testsLO-1.2, 2.1, 2.3, 2.4, 3.1–3.3, 4.1–4.4, 5.1, 5.3, 5.4
PA2: Text and collections (notebook)Its visible tests, and the scoring notes for its written answerLO-6.1–6.4, 7.1–7.4, 8.1–8.4, 4.3, 5.4
Project 1: A terminal gameThe brief’s checklist and rubricLO-5.4, 7.1, 8.1, 8.2, 9.2–9.4, 10.1–10.3, 3.2, 4.3
Project 2: A command-line data toolThe published acceptance tests, your own tests, and the rubricLO-9.2, 9.3, 9.5, 10.1, 10.2, 11.1–11.3, 12.2, 12.3, 13.1–13.4, 8.1, 8.2, 10.3
PA3: Objects and iterators (notebook)Its visible testsLO-14.1–14.4, 15.1, 15.3, 16.1–16.4, 12.3, 13.1
Self-test 1, after Module 8The answers and scoring notes in the pageModules 1–8
Self-test 2, after Module 13The answers and scoring notes in the pageModules 1–13, weighted toward 9–13
Self-test 3, after Module 18The answers and scoring notes in the pageAll modules, weighted toward 14–18
Capstone project: proposal, milestone, and releaseThe brief’s checklists and rubric, and the course’s project checkerLO-10.3, 10.4, 13.1–13.4, 14.1–14.4, 15.2, 17.1–17.3 as your idea needs them, 18.1–18.3

Later pieces revisit earlier objectives on purpose, so that you keep practicing them.

Policies

Course materials