Python Programming - Encapsulation - Discussion

Discussion Forum : Encapsulation - General Questions (Q.No. 47)
47.
Which of the following access specifiers in Python is used to indicate that a variable or method should be accessible only within its own class and not from outside?
Public
Private
Protected
Global
Answer: Option
Explanation:
The private access specifier in Python (indicated by a single underscore or double underscore prefix) restricts access to variables and methods only within their own class.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.