Vidyalelo
Python · Q74

MCQs for Python Strings: Exam

Programming · Python · question 74

Q74

If a class defines the __str__(self) method, for an object obj for the class, you can use which command to invoke the __str__ method.

A.
obj.__str__()
B.
str(obj)
C.
print obj
D.
all of the mentioned
Answer

Answer: Option D

Solution

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