course content

Course Content

In-Depth Python OOP


The methods of the class are functions for instances. You can define a function inside the class and use it from instances:



You can access the instance attributes via the self argument inside methods.

The is equal to:

Where self is the bon instance and distance is 56.

Let's implement the ThreeNumbers class with a method named total that returns the sum of three numbers.


So, the self argument allows access to the values num1, num2, and num3 through the instance.


What is a method?

Select the correct answer

Everything was clear?

Section 1. Chapter 7