Skip to content

Methods, Initialization, and Introspection

Step 24 of 41

Methods and Object Initialization

Introduction

This is the first lesson of chapter 9 in the Object-Oriented Programming section of PCAP-31-03 (34% of the score, 12 of 40 items). It covers objective 4.3 (methods and the self parameter) and objective 4.6 (declaring and invoking constructors), and prepares the inheritance chapter by introducing how a subclass initialises its parent. Exam items on this topic ask you to trace a short class, count the arguments of a call, or spot the line that raises TypeError. The rules are few and strict, so careful reading is rewarded.