Back to Developer Roadmap

Encapsulation

src/data/roadmaps/python/content/[email protected]

4.0868 B
Original Source

Encapsulation

Encapsulation is a way to bundle data (attributes) and the methods that operate on that data into a single unit, known as a class. It restricts direct access to some of the object's components and prevents the accidental modification of data. This is achieved by declaring some attributes or methods as private, meaning they can only be accessed from within the class itself.

Visit the following resources to learn more: