Vidyalelo
Python · Q34

Concept of Object Oriented Programs in Python

Programming · Python · question 34

Q34

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 method
D.
It removes an attribute

Answer: Option A

Solution

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