Python Foundations

14 chapters · 54 lessons

Python gives us a way to express instructions, work with information, and build programs that make decisions. This course begins with the first line of code and builds toward reading and combining the core ideas in a small Python program.

Who this course is for

This course is written for people who have not programmed before. Each chapter groups related lessons; each lesson is a separate page. Read the chapters in order, since later examples use ideas introduced earlier. Code is presented as worked examples, not as required assignments.

A Python 3.10 or newer environment is useful if you want to try all the examples, but the lessons can be read without one. Some later type-annotation syntax does not work on older Python versions. Output and error messages can vary across Python versions and environments. This course does not assess independent programming ability.

Course path

  1. From ideas to programs
  2. Values and names
  3. Building with functions
  4. Where names belong
  5. Checking our work
  6. Working with computation
  7. Making decisions
  8. Repeating work
  9. Sequences of values
  10. Mapping keys to values
  11. Unique values
  12. Handling failure
  13. Describing types
  14. Putting ideas together

At the end

The final course assessment contains 20 choice questions spanning the course. Each answer includes an explanation and a link back to the relevant lesson. It evaluates understanding of the material, not whether someone can independently write or operate a program.