oop_encapsulation

Concept of encapsulation is to keep together the implementation (code) and the data it manipulates (variables). Python does not have the private keyword, unlike some other object oriented languages. In python, we can restrict access to methods and variables. This prevents data from being modified (encapsulation). In python, we denote private attributes using underscore _ or dunder (double underscore) __ as the prefix.