AI engineering glossary · Python advanced

What is self?

self: By convention, the name of the first parameter of an instance method. It receives the object the method was called on, so the method can read and modify that object's own data. It is a naming convention, not a keyword.

Level: beginnerTopic: Python advanced

self: an example

In def deposit(self, amt): self.balance += amt, self is whichever account called deposit.

Related terms

More Python advanced terms

Where you learn it

self is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.