Learn Before
Encapsulation in Python
Encapsulation is an important concept of OOP. It is used to make data in a class private so that the data can not be accessed outside of the class. We create a getter method, for the object to safely access the data without directly interacting with the data itself. We make a variable private by prefixing the variable name by double underscores, e.g. __password = 123
0
1
Tags
Python Programming Language
Data Science
Related
Defining Classes in Python
Class Variable vs Instance Variable
Class Inheritance
"Self" Keyword in Python Class
init() method in Python
Methods vs. Functions
Encapsulation in Python
Class Composition
Math Constants
Math Constants
Useful Math Constants in Python
The add_to_class Utility Function
The HyperParameters Utility Class
The ProgressBoard Utility Class
Base Module Class in Deep Learning Implementation