Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Methods
course content

Course Content

In-Depth Python OOP

MethodsMethods

Methods are actions or operations that can be performed on a particular object.
For example, if an airplane is an object, its methods might include takeoff, landing, moving, changing speed, steering, checking status, and so on. Methods help an object perform various tasks and interact with it in program code.

Object

The methods of a class are functions designed to be used by instances. You can define a function within the class and utilize it with instances.

Note

You can retrieve the instance attributes using the self parameter within methods.

The bon.fly(56) is equal to:

Where self is the bon instance and distance is 56.

question-icon

What is a method?

Select the correct answer

Everything was clear?

Section 1. Chapter 7
some-alt