Python Programming - Encapsulation - Discussion

Discussion Forum : Encapsulation - General Questions (Q.No. 16)
16.
In Python, what is the purpose of the __init__() method in the context of encapsulation?
To initialize a class instance with default values
To define a private variable
To create a new instance of the class
To hide the implementation details of a class
Answer: Option
Explanation:
The __init__() method in Python is used to initialize a class instance with default values, contributing to encapsulation.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.