Module 03 of 10

OOP & Functional Python

Lessons

About This Module

As programs grow, you need ways to keep them organised and readable. Python supports two complementary styles for this: object-oriented programming, which groups data and behaviour into objects, and a functional style, which builds results by transforming data with small, focused expressions.

You'll start with classes and instances, learning how to model real things in code, then use inheritance to reuse and extend existing classes. Next come special (dunder) methods, which let your objects work naturally with Python's built-in features. Finally, comprehensions show how to build lists, dictionaries, and sets in a single readable line.

With these techniques in hand, you'll be ready for the next module, Environments & Packaging, where you'll learn how to manage dependencies and share your code as projects.

Lessons

4 videos
01

Python OOP Tutorial 1: Classes and Instances

What classes and instances are, how to create them with __init__, and how to give objects their own attributes and methods.

02

Python OOP Tutorial 4: Inheritance - Creating Subclasses

Building subclasses that inherit from a parent class, overriding behaviour, and using super() to reuse code.

03

Python OOP Tutorial 5: Special (Magic/Dunder) Methods

How methods like __repr__, __str__, and __add__ let your own classes behave like Python's built-in types.

04

Python Tutorial: Comprehensions - How they work and why you should be using them

Creating lists, dictionaries, and sets in one line with comprehensions, and why they are a clean alternative to map and filter.