Vidyalelo
Python · Q14

Classes and Objects in Python

Programming · Python · question 14

Q14

What is the purpose of the __str__ method in Python classes?

A.
It returns a string representation of an object
Answer
B.
It converts an object to a string
C.
It defines a string attribute
D.
It removes an attribute

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board