Intermediate Python Course

Free online course · 9 lessons

Deepen Python with object-oriented design, iterators and generators, decorators, regular expressions, data formats and web APIs, testing, packaging, type hints and concurrency. After the course you can build and maintain a small Python project the way professional teams do.

By Studeli

Start with lesson 1

What you will learn in 9 lessons

Every lesson includes all nine study tools

  • Study Guide
  • Summary
  • Walkthroughs
  • Practice Questions
  • Flashcards
  • Explain It
  • Key Terms
  • Cheat Sheet
  • Concept Map
  1. Python Classes

    Start here

    Design class hierarchies with inheritance and composition, override methods and use special methods and dataclasses to write expressive types.

    6 learning goals
    1. 1.Build class hierarchies with inheritance
    2. 2.Override methods and program to shared interfaces
    3. 3.Choose between composition and inheritance
    4. 4.Give classes built-in behavior with special methods
    5. 5.Control attribute access with properties
    6. 6.Write concise data classes with dataclasses
  2. Write comprehensions for lists, dictionaries and sets, explain the iterator protocol and build lazy data pipelines with generators and itertools.

    5 learning goals
    1. 1.Write comprehensions for lists, dictionaries and sets
    2. 2.Sort and select data with lambda and key functions
    3. 3.Explain how iteration works with iterables and iterators
    4. 4.Write generators with yield and generator expressions
    5. 5.Build lazy data pipelines with built-ins and itertools
  3. Use functions as values, write closures and decorators, and accept flexible arguments with variable-length and keyword-only parameters.

    6 learning goals
    1. 1.Use functions as values
    2. 2.Design flexible function signatures
    3. 3.Apply Python's scope rules
    4. 4.Write and use closures
    5. 5.Write decorators
    6. 6.Use the functools module
  4. Search, validate and extract text with regular expressions and string tools, and clean messy text data.

    5 learning goals
    1. 1.Write regular expression patterns
    2. 2.Search and extract with the re module
    3. 3.Capture parts of a match with groups
    4. 4.Validate input with regular expressions
    5. 5.Transform and clean messy text
  5. Read and write structured data in CSV and JSON, call web APIs over HTTP and handle the responses and errors safely.

    5 learning goals
    1. 1.Find, read and write files with pathlib
    2. 2.Read and write CSV data with the csv module
    3. 3.Serialize and parse JSON data
    4. 4.Request data from web APIs
    5. 5.Handle timeouts, errors and unreliable services
  6. Write automated unit tests with pytest, use fixtures and parametrization and apply test-driven development to small features.

    6 learning goals
    1. 1.Write and run tests with pytest
    2. 2.Organize a test suite
    3. 3.Share setup with fixtures
    4. 4.Test many inputs with parametrization
    5. 5.Replace dependencies with test doubles
    6. 6.Measure coverage and develop test-first
  7. Organize code into modules and packages, manage dependencies in virtual environments and configure a project with pyproject.toml.

    5 learning goals
    1. 1.Organize code into modules and packages
    2. 2.Manage dependencies with virtual environments and pip
    3. 3.Configure a Python project with pyproject.toml
    4. 4.Build command-line interfaces with argparse
    5. 5.Record what a program does with logging
  8. Annotate code with type hints, check it with a static type checker and apply style guides, linters and refactoring to keep code readable.

    5 learning goals
    1. 1.Annotate functions and data with type hints
    2. 2.Check code with a static type checker
    3. 3.Write reusable generic and structural types
    4. 4.Write consistent, documented code that follows the Python style guide
    5. 5.Recognize code smells and refactor small functions safely
  9. Explain when threads, processes and asyncio help, and write simple concurrent programs for I/O-bound and CPU-bound tasks.

    6 learning goals
    1. 1.Explain how concurrency works in Python
    2. 2.Run I/O-bound tasks with threads
    3. 3.Use processes for CPU-bound work
    4. 4.Run tasks with concurrent.futures executors
    5. 5.Write asynchronous programs with asyncio
    6. 6.Choose, combine and measure concurrency models

What to take next

More Programming courses
Before this: Introduction to Programming with Python (Beginner)

You have never programmed, or you tried once and want a structured first course in a general-purpose language.

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started