Subclasses

We're going to learn about subclassing (or inheritance) in Python

We'll cover the following

The real power of classes becomes apparent when you get into subclasses. You may not have realized it, but we’ve already created a subclass when we created a class based on object. In other words, we subclassed object. Now because object isn’t very interesting, the previous examples don’t really demonstrate the power of subclassing. So let’s subclass our Vehicle class and find out how all this works.

Get hands-on with 1400+ tech skills courses.