Python Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 19)
19.
What is the purpose of the __init__() method in Python classes?
Initializes the class object
Declares a new instance variable
Defines the class constructor
Prints the class attributes
Answer: Option
Explanation:
The __init__() method is a special method in Python classes that is automatically called when a new instance of the class is created. It is used to initialize the object's attributes.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.