Examveda

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

A. It returns a string representation of an object

B. It converts an object to a string

C. It defines a string attribute

D. It removes an attribute

Answer: Option A


This Question Belongs to Python Program >> Classes And Objects In Python

Join The Discussion

Related Questions on Classes and Objects in Python