Title: getters and setters in Python
Getters and Setters are used to ensure data encapsulation in OOP.
In python they are not the same as in other languages, because private variables are not hidden in python.
Getters and Setters are used to add validation for getting and setting values or to avoid direct access of a class field.
📌 get() and set() methods don't fully work as getters and setters. In this case, python has a special function property()
Sources: Python cookbook and geeksforgeeks
Post #87
441
