Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 96)
96.
In Python, what is the purpose of the __repr__() method in a class?
To define class attributes
To create a new instance of the class
To represent the object as a string for debugging
To access superclass attributes directly
Answer: Option
Explanation:
The __repr__() method is used to provide a string representation of the object, often for debugging purposes.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.