What is self?

'self' has a special place while working with classes in python

Python classes need a way to refer to themselves. This isn’t some kind of narcissistic navel-gazing on the part of the class. Instead, it’s a way to tell one instance from another. The word self is a way to describe itself, literally. Let’s take a look at an example as I always find that helpful when I’m learning something new and strange:

If you add the following code to the end of that class you wrote to create the Vehicle class:

Get hands-on with 1200+ tech skills courses.