Python Programming - Objects - Discussion
Discussion Forum : Objects - General Questions (Q.No. 12)
12.
What is the primary purpose of the
__str__
method in Python classes?
Answer: Option
Explanation:
The
__str__
method is used to define the string representation of an object. It is automatically called when the str()
function is invoked on the object.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers