Concepts·Certified Associate Python Programmer
Python Methods and self
PCAP objective 4.3 is equip a class with methods. A method is a function defined in a class whose first parameter receives the instance - and `self` is only a convention for that parameter's name. The examinable consequences are the two `TypeError`s the extra argument produces, and the fact that `obj.method` and `Class.method` are different objects.
Object-Oriented Python Guide 14 of 25 Intermediate
- Python3.14.4
- OSUbuntu 26.04 LTS
- pip25.1.1
- TimeAbout 15 min
- Reviewed23 August 2026
Written against the versions above. Unbound methods were removed in Python 3: `Class.method` is a plain function now, not a special object. Python 2 material describing unbound methods no longer applies.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RUNNER01 | 192.168.0.27 | Ubuntu 26.04 LTS | Python 3.14.4 - the only machine this path needs | 2 Core | 4 GB | 50 GB |
Before you start
-
self is the instance
-
The same method reached two ways
-
One argument too many
-
Forgetting self in the definition
-
self is a convention, not a keyword
-
Methods calling methods
-
Forgetting self inside the method
-
What the exam does with this objective