Teacher-curated, self-paced courses. Looking for a guided sequence through a full topic? See Learning Paths.
A class does not have to start from nothing. A Dog is a kind of Animal, and a savings account is a kind of bank account. In this course you build one class on another with inheritance, replace a method in the child class, and let objects of different classes answer the same call in their own way, which is called polymorphism. You teach your own objects to work with print, equality, sorting, adding and len by writing special methods, and you learn when to build on a class and when to put one object inside another. A deck of playing cards is the project at the end. The practice runs your classes on real cases and tells you which ones fail.
Until now you have used the kinds of thing that Python gives you. A class lets you make your own: a bank account with a balance and a deposit action, a student with marks and an average, a book that can be borrowed and returned. In this course you see that you already use objects every day, write a class with its attributes and methods, keep the rules of a thing inside the thing, make many objects from one class, and tell the data of the class from the data of one object. A small library system is the project at the end. The practice runs your classes on real cases and tells you which ones fail.