Skip to content

Objects, Classes, and Shared State

Step 22 of 41

Track Instance and Class Properties

Introduction

This is the second lesson of chapter 8 in the Object-Oriented Programming section of PCAP-31-03 (34% of the score, 12 of 40 items). It is the core of objective 4.2: the difference between instance variables and class variables, the __dict__ property, and private components with name mangling. These topics produce some of the most deceptive code-tracing questions on the exam, because the program looks innocent and the printed output depends on exactly where each attribute lives.