Python Programming - Encapsulation - Discussion

Discussion Forum : Encapsulation - General Questions (Q.No. 21)
21.
What is the primary purpose of encapsulation?
To allow unrestricted access to class members
To combine data and methods into a single unit
To create multiple instances of a class
To expose all implementation details of an object
Answer: Option
Explanation:
The primary purpose of encapsulation in Python is to combine data and methods into a single unit, promoting modularity.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.