AI engineering glossary · Python advanced
What is method?
Method: A function defined inside a class that operates on an object of that class. When called through an object, Python automatically passes that object as the first argument. Methods carry the behaviour of the class and can read or change its data.
Method: an example
class Counter: def add(self): self.n += 1 c.add() increments the counter c.
Related terms
More Python advanced terms
Where you learn it
Method is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.