Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 38)
38.
How can you achieve encapsulation in Python without using private attributes?
By using the @private decorator
By using single leading underscores in attribute names
Encapsulation is not possible without private attributes
By using the @encapsulate decorator
Answer: Option
Explanation:
Encapsulation in Python can be achieved by using a single leading underscore in attribute names, indicating that they are intended for internal use.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.