Write object-oriented Python: classes, inheritance, properties, special methods, and dataclasses.
Three courses in, your data lives in dictionaries and the code that touches it lives in functions, and the two keep drifting apart. A class is how you staple them back together: the thing and everything it knows how to do, in one place, with a name. That is the whole idea, and everything else in this course is a consequence of it. Most courses teach inheritance next. This one teaches special methods first, because they are what makes a Python class feel like Python rather than a transplant from another language. An object that prints readably, compares with the equals sign and sorts with `sorted` is participating in the language instead of sitting beside it. Inheritance follows, and then the argument against reaching for it too often: composition, where an object is made of other objects rather than descended from them. Everything is built on the Repair Café, a community fix-it shop that grows through the course: a repair as an object, a repair that can estimate itself, tickets numbered by the class, repairs that print and sort, repair types that differ by kind, a workbench that refuses to be overloaded, a café made of benches and volunteers, a log written as dataclasses with real dates, and finally the whole board. By the end you can design a small object model where each class earns its place, which is the part nobody teaches and every reviewer notices.
45 Lessons • 53 Practices • 18 Quizzes • 4 Projects · ~10h Total
Not just theory. You finish this course with real work to show.
This is the same in-browser editor every lesson uses. Edit the code, hit Run.
Run code in the browser and see the result immediately. Every lesson works this way.
Stuck? Puff explains the error and nudges you forward, without giving the answer away.
Streaks, diamonds, and certificates. Your progress saves automatically, forever.
Every completed course issues a certificate with a public verification link.
Every certificate has a public verification link employers can check.
One certificate per course. Finish a program and earn its program certificate too.
LinkedIn-ready, with a PDF you can download and attach.
Your data and the code that touches it keep drifting apart. This is how they stay together.
You know what a class is. This is the Python spelling, and the Python habits that go with it.
Every model you are about to meet is a class. This is where that stops being a mystery.
Object-Oriented Python is free to start, no credit card needed. Some later sections are part of Pro, and finishing every section, including the certificate, needs a Pro plan.
Yes, and Python Functions especially. Decorators are assumed rather than re-taught: `@property`, `@classmethod` and `@dataclass` all turn up here, and if you have never written a decorator by hand they will read as magic instead of as ordinary functions.
It is the instance the method was called on, handed to the method as its first argument. Writing `toaster.estimate()` is Python calling `Repair.estimate(toaster)`, so `self` is `toaster` for the length of that call. Nothing is hidden and nothing is special: it is a parameter with a conventional name, which is why forgetting it produces an error about argument counts.
Less often than you would think. Inheritance is for is-a: an electrical repair is a repair. If you are reaching for it to share a bit of code, that is usually has-a instead, and section 7 makes the case with an example you rewrite both ways.
No. `@dataclass` is a decorator that writes the boring parts for you, the initializer and the printout and the comparisons, and hands back an ordinary class. Section 8 converts the class you have carried for seven sections and deletes about fifteen lines doing it.
The Repair Café: a repair object, a ticket desk that numbers its own tickets, repairs that sort themselves, a workbench that refuses invalid values, a café assembled from parts, a dated repair log, and a full board as the capstone.
Yes, for this course at 100 percent. It also counts towards the Python Developer program certificate, which issues once every course in that program is complete.
How this course connects to the bigger picture, and what to explore next.
Handle errors and work with real files in Python: text, CSV, JSON, paths, and regular expressions.
Go deeper into Python functions: arguments, scope, lambdas, decorators, generators, and modules.
Write real Python in your browser: variables, strings, conditionals, loops, lists, and functions.
Free to start, no credit card required. Write real code from the first lesson and keep your progress forever.
Start Learning Free