Getter methods and @property
A decorator above a getter method. It lets outside code read a private attribute like a normal attribute, such as obj.name, with no brackets. With no setter, the attribute is read-only.
Understanding Getter methods and @property in VCE Software Development U4O1
What it does: The getter is called with brackets, and it returns the private balance for printing. With only @property and no setter, trying to change the value fails with an AttributeError. A getter gives controlled, read access to a private attribute. The class stays in charge of its own data, which supports encapsulation. A normal getter is a method, so you need brackets to call it. Without them you only get the method itself, not the value. Python uses the built-in @property decorator. There is no @getter decorator in Python. @property sits above the getter so the student can write obj.name instead of obj.get_name().
Common mistakes: A getter method inside a class needs self as its first parameter so it can reach self.__name. It should be def get_name(self):. A class header must end with a colon. It should be class Pet:.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 3–79) and word search (Modules 3–114).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
@propertyFill in the Blanks
Spot the Error
Student with a class code? Join your class →