ProgrammingLearning library

Python and practical programming

Learn to read programs, solve small problems, and organize reliable Python projects.

Beginner20 chapters14 practice questions9 references

Get an in-app notice when new lessons or practice are added.

20 chapters across 6 modules

Course chapters

Explore all 20 chapters in any order. Each chapter has learning goals, a practice prompt, and a primary reference; expanded reading pages are linked from their chapter titles.

01 · Getting started4 chapters
  1. Run your first program

    • Distinguish a Python file, interpreter, and terminal command

    Practice: Create a greeting script and run it from a terminal.

    Read the primary referenceLesson guide · Ready
  2. Names, values, and types

    Understand assignment by following which value each name refers to.

    • Recognize strings, numbers, booleans, and assignment

    Practice: Describe three measurements with suitable values and names.

    Read the primary referenceExpanded reading · Ready
  3. Strings and user input

    • Transform text and convert user input deliberately

    Practice: Validate a page-count response and format a message.

    Read the primary referenceLesson guide · Ready
  4. Decisions and comparisons

    • Trace if, elif, and else at boundary values

    Practice: Classify a temperature and test both threshold boundaries.

    Read the primary referenceLesson guide · Ready
02 · Functions and collections4 chapters
  1. Loops and accumulation

    • Trace for and while loops and explain loop termination

    Practice: Compute a total without modifying the collection being visited.

    Read the primary referenceLesson guide · Ready
  2. Functions and return values

    Separate reusable calculation from displaying a result.

    • Separate function inputs, returned results, and printed output

    Practice: Write a reusable price calculator with boundary examples.

    Read the primary referenceExpanded reading · Ready
  3. Lists, tuples, and dictionaries

    • Choose collections according to ordering, mutability, and lookup needs

    Practice: Model a reading log and retrieve a record by a meaningful key.

    Read the primary referenceLesson guide · Ready
  4. Sets and comprehensions

    • Use uniqueness and transformations without obscuring intent

    Practice: Normalize duplicate tags and construct a filtered list.

    Read the primary referenceLesson guide · Ready
03 · Reliable programs4 chapters
  1. Exceptions and tracebacks

    • Read a traceback and handle a specific expected failure

    Practice: Handle invalid numeric input without hiding unrelated errors.

    Read the primary referenceLesson guide · Ready
  2. Files and context managers

    • Use explicit encodings and explain read, append, and write modes

    Practice: Read a small text file and handle an absent file.

    Read the primary referenceLesson guide · Ready
  3. Modules and environments

    • Distinguish standard-library imports and third-party dependencies

    Practice: Organize two modules in an isolated project environment.

    Read the primary referenceLesson guide · Ready
  4. Tests and debugging

    • Choose normal, empty, invalid, and boundary examples

    Practice: Test a summary function using assertions and a reproducible failure.

    Read the primary referenceLesson guide · Ready
04 · Applied Python4 chapters
  1. Classes and data models

    • Represent state and behavior with a small class

    Practice: Create a reading-session object with a clear invariant.

    Read the primary referenceLesson guide · Ready
  2. CSV and JSON data

    • Read structured records and validate expected fields

    Practice: Summarize a local CSV and export a JSON report.

    Read the primary referenceLesson guide · Ready
  3. Command-line tools

    • Separate argument parsing from application logic

    Practice: Build a command-line word counter with helpful error messages.

    Read the primary referenceLesson guide · Ready
  4. Mini project: data summary

    • Combine functions, collections, files, and tests in one program

    Practice: Publish a small dataset report with assumptions and test cases.

    Read the primary referenceLesson guide · Ready
05 · Further Python practice3 chapters
  1. Type hints and readable contracts

    • Explain what type annotations document and what they do not enforce automatically

    Practice: Annotate a small function and compare annotations with runtime validation.

    Read the primary referenceLesson guide · Ready
  2. Iterators and generators

    • Explain lazy iteration and one-pass consumption

    Practice: Process a sequence using a generator without materializing every item.

    Read the primary referenceLesson guide · Ready
  3. Packaging and documentation

    • Describe a reproducible project environment and usage instructions

    Practice: Prepare a small project README with setup, examples, and test commands.

    Read the primary referenceLesson guide · Ready
06 · Further foundations and worked reasoning1 chapter
  1. Generators and iteration

    Trace suspension, exhaustion, and the difference between a recipe and a stored collection.

    • Explain lazy iteration and when a generator’s body executes

    Practice: Process lines lazily and test exhaustion, empty input, and early termination.

    Read the primary referenceExpanded reading · Ready

Learn it. Check it. Try again.

14 original questions with worked explanations and source references. Filter by difficulty, revisit mistakes, and save your attempt as you go.

Open Python and practical programming practice

In-depth study guide

Follow the subject from its foundations through worked examples and practice. Each guide includes its scope, version assumptions, solutions, and sources for further study.

OpenLearning study guideEdition 2026.12

Python: From First Program to Reliable Tools

A detailed original guide to Python values, program flow, functions, collections, files, modules, objects, testing, performance, and an integrated reading-ledger project.

pages
88
chapters
16
diagrams
11
exercises with solutions
32

9,199 words of explanations and practice · 18 worked examples · 16 review questions

Improve this guide on GitHubOriginal text · CC BY-SA 4.0

Browse all study guides

Books & references

Free reading at the publisher or author’s site. External materials keep their own licenses.